note 91749 added to function.strtr
| From: | lev at taintedthoughts dot com | Date: | Wed, 24 Jun 2009 16:21:55 +0000 |
| Subject: | note 91749 added to function.strtr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157377@lists.php.net to get a copy of this message | ||
The code provided by allixsenos at gmail dot com, didn't work for me. It took me a while to
figure out while my characters weren't being replaced, but I eventually discovered it was
related to the character encoding.
If you can't get allixsenos's code to run, in the beginning of the function add this:
$string = utf8_encode($string);
With this in place, the characters began to translate just as expected.
If that doesn't work, you can always try utf8_decode instead, as your situation may be the
complete opposite of mine.
----
Server IP: 80.67.2.2
Probable Submitter: 83.233.149.159
----
Manual Page -- http://www.php.net/manual/en/function.strtr.php
Edit -- https://master.php.net/note/edit/91749
Del: integrated -- https://master.php.net/note/delete/91749/integrated
Del: useless -- https://master.php.net/note/delete/91749/useless
Del: bad code -- https://master.php.net/note/delete/91749/bad+code
Del: spam -- https://master.php.net/note/delete/91749/spam
Del: non-english -- https://master.php.net/note/delete/91749/non-english
Del: in docs -- https://master.php.net/note/delete/91749/in+docs
Del: other reasons-- https://master.php.net/note/delete/91749
Reject -- https://master.php.net/note/reject/91749
Search -- https://master.php.net/manage/user-notes.php