note 79006 added to function.utf8-encode
| From: | ethan dot nelson at ltd dot org | Date: | Wed, 07 Nov 2007 01:42:35 +0000 |
| Subject: | note 79006 added to function.utf8-encode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132054@lists.php.net to get a copy of this message | ||
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);
}
}
}
----
Server IP: 208.69.120.35
Probable Submitter: 140.211.84.125
----
Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php
Edit -- https://master.php.net/note/edit/79006
Del: integrated -- https://master.php.net/note/delete/79006/integrated
Del: useless -- https://master.php.net/note/delete/79006/useless
Del: bad code -- https://master.php.net/note/delete/79006/bad+code
Del: spam -- https://master.php.net/note/delete/79006/spam
Del: non-english -- https://master.php.net/note/delete/79006/non-english
Del: in docs -- https://master.php.net/note/delete/79006/in+docs
Del: other reasons-- https://master.php.net/note/delete/79006
Reject -- https://master.php.net/note/reject/79006
Search -- https://master.php.net/manage/user-notes.php