note 20689 deleted from function.utf8-encode by joey
| From: | joey@php.net | Date: | Mon, 29 Apr 2013 13:01:02 +0000 |
| Subject: | note 20689 deleted from function.utf8-encode by joey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194650@lists.php.net to get a copy of this message | ||
Note Submitter: sts at netempire dot de at nospam dot remove at this dot com
----
if you want to encode/decode arrays, use these recursive functions
function utf8_encode_array (&$array, $key) {
if(is_array($array)) {
array_walk ($array, 'utf8_encode_array');
} else {
$array = utf8_encode($array);
}
}
function utf8_decode_array (&$array, $key) {
if(is_array($array)) {
array_walk ($array, 'utf8_decode_array');
} else {
$array = utf8_decode($array);
}
}
and call them with array_walk for e.g.
array_walk ($array_unencoded, 'utf8_decode_array');