note 79006 deleted from function.utf8-encode by ezyang

From: Date: Wed, 07 Nov 2007 02:21:31 +0000
Subject: note 79006 deleted from function.utf8-encode by ezyang
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-132058@lists.php.net to get a copy of this message
Note Submitter: ethan dot nelson at ltd dot org Reason: bad code ---- 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); } } }

« previous php.notes (#132058) next »