link mingle home | logged in as: guest | login/register| submit link


IndiaDiscuss.com : Social Bookmarkings and News Networking Site for India
syam1224
Bookmarks
How to get PHP to stop How to get PHP to stop 'mis-rendering' some entities like ™ and single smart quotes.

View Story
8
Votes

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-
saved under FAQS/PHP by syam1224

 
IndiaDiscuss | Published News | Hot
Indian Social News and Links Network
IndiaDiscuss | Published News
Indian Social News and Links Network