Re: convert special characters.

From: Date: Thu, 09 Aug 2012 10:41:17 +0000
Subject: Re: convert special characters.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-48392@lists.php.net to get a copy of this message
On Aug 9, 2012, at 5:37 AM, Karl DeSaulniers wrote:
Help! How do I get special characters to convert correctly when inserting and reading from my database. For example. é => é ë => ë I keep getting ë and é using htmlentities, htmlspecialchars, etc... Any pointers? Please! Going bald over here. here is my funcitons function stringToMysqlFormat($original_input) {
              //for inserting the data with special characters INTO mysql
              $html_encoded = htmlentities(mysql_real_escape_string($original_input));
              return $html_encoded;
} function mysqlToHTMLFormat($encoded) {
              //for displaying the data FROM mysql
              $html_decoded = html_entity_decode(stripslashes($encoded));
              return $html_decoded;
} TIA, Karl DeSaulniers Design Drumm http://designdrumm.com
using UTF-8 Karl DeSaulniers Design Drumm http://designdrumm.com

« previous php.db (#48392) next »