note 108339 deleted from function.utf8-decode by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 11:28:10 +0000 |
| Subject: | note 108339 deleted from function.utf8-decode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208521@lists.php.net to get a copy of this message | ||
Note Submitter: chris at deliens dot be
----
I didn't see any post showing a way to recursively utf8_decode an array.
So here's one I've just built for this purpose:
function utf8DecodeArray($array) {
$utf8DecodedArray = array();
foreach ($array as $key => $value) {
if (is_array($value)) {
$utf8DecodedArray[$key] = utf8DecodeArray($value);
continue;
}
$utf8DecodedArray[$key] = utf8_decode($value);
}
return $utf8DecodedArray;
}