note 20689 added to function.utf8-encode
| From: | sts at netempire dot de at nospam dot remove at this dot com | Date: | Fri, 12 Apr 2002 12:18:50 +0000 |
| Subject: | note 20689 added to function.utf8-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29158@lists.php.net to get a copy of this message | ||
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');
--
http://www.php.net/manual/en/function.utf8-encode.php
http://master.php.net/manage/user-notes.php?action=edit+20689
http://master.php.net/manage/user-notes.php?action=delete+20689
http://master.php.net/manage/user-notes.php?action=reject+20689