note 103700 added to function.json-decode

From: Date: Thu, 28 Apr 2011 19:53:00 +0000
Subject: note 103700 added to function.json-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-179247@lists.php.net to get a copy of this message
Pongo a la comunidad una función para transformar un JSON de ISO a UTF8 function iso_to_utf8_json($inArray) { static $profundidad = 0; /* our return object */ $newArray = array(); //aqui valido que no se puede ingresar mas en profundidad /* safety recursion limit */ if ($profundidad > '5') { return false; } /* step through inArray */ foreach ($inArray as $key => $val) { if (is_array($val)) { /* recurse on array elements */ $profundidad++; $newArray[$key] = iso_to_utf8_json($val, $cantidadVueltas); } else { /* encode string values */ $newArray[$key] = utf8_encode($val); } } $profundidad--; /* return utf8 encoded array */ return $newArray; } by Miguel Quiroz ---- Server IP: 69.147.83.197 Probable Submitter: 186.68.119.73 ---- Manual Page -- http://www.php.net/manual/en/function.json-decode.php Edit -- https://master.php.net/note/edit/103700 Del: integrated -- https://master.php.net/note/delete/103700/integrated Del: useless -- https://master.php.net/note/delete/103700/useless Del: bad code -- https://master.php.net/note/delete/103700/bad+code Del: spam -- https://master.php.net/note/delete/103700/spam Del: non-english -- https://master.php.net/note/delete/103700/non-english Del: in docs -- https://master.php.net/note/delete/103700/in+docs Del: other reasons-- https://master.php.net/note/delete/103700 Reject -- https://master.php.net/note/reject/103700 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#179247) next »