help | forum home | logged in as: guest | login/register
link mingle
syam1224
Bookmarks
Home » syam1224 »
FAQS RSS
PHP
Save Link Create/Add to List

How to get PHP to stop How to get PHP to stop 'mis-rendering' some entities like ™ and single smart quotes.
saved under FAQS/PHP by syam1224

1. Don't use addslashes()! Use mysql_real_escape_string(). 2. Send a utf-8 header from php before you send any of the page's content: header("Content-type: text/html; charset=utf-8"); 3. As soon as you connect to mysql, do a mysql_query("SET NAMES 'utf8'"); to set the connection's encoding to utf-8, which is often necessary in php/mysql apps. 4. You want this meta tag in the section to be absolutely safe: 5. Good luck :-)
http://ask.metafilter.com/28045/How-to-get-PHP-to-
created by syam1224 on 2008-02-28 07:39:05

0
 
Thumbnails by Thumbshots.com