note 79005 deleted from function.utf8-encode by cmb
| From: | cmb@php.net | Date: | Sun, 04 Dec 2016 12:12:47 +0000 |
| Subject: | note 79005 deleted from function.utf8-encode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208197@lists.php.net to get a copy of this message | ||
Note Submitter: ethan dot nelson at ltd dot org
----
This does the same thing as some of the posts below (minus the keys), but I thought I'd share
anyway cause it is slightly more elegant. Also, its a good example using references such that this
could be used as a callback function.
function utf_prepare(&$array) {
foreach($array AS $key => &$value) {
if (is_array($value)) {
$this->utf_prepare($value);
} else {
$value = utf8_encode($value);
}
}
}