Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- How to blend adsense inside your post?
- Formatting my post
- PHPWind-- A PHP forum script applcaition in China
- Promote your Forum/Blog/Website via major search Engines
- Install PHP ibm_db2 extension in Linux (redHat)
- Google Adsense forum and pin number
- Install PHPMailer 5.2.4 and use smtp gmail
- phpexcel toggle expand and hide column in EXCEL and summary
- Datatable export excel wraptext and newline
- PHP - Export Content to MS Word document
Monday, October 24, 2011
PHP, text after apostrophe or hyphen cutoff
In some scenarios when a piece of text is pasted from Word to online visual editor, if the text contains an apostrophe or hyphen, all text that comes after the apostrophe or hyphen will not cutoff in MYSQL database. mb_convert_encoding function can be used to solve this problem:
$sql_subject =mb_convert_encoding($_POST['subject'], 'HTML-ENTITIES', 'OLD-ENCODING');
$sql_subject =ereg_replace("’", "'", $sql_subject);
$sql_subject=$addslashes(html_entity_decode($sql_subject));
’ is for ', mb_convert_encoding will automatically solve hyphen cutoff problem.
For using function mb_convert_encoding:
In C:/php5.3.1/php.ini, line 960, un-comment
extension=php_mbstring.dll
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment