Exemplo n.º 1
0
Arquivo: utf8.php Projeto: rair/yacs
 /**
  * transcode arrays recursively
  *
  * @param array the variable to convert
  * @return converted object (which is also the input array)
  */
 public static function to_unicode_recursively(&$input)
 {
     global $context;
     // sanity check
     if (!is_array($input)) {
         return utf8::to_unicode($input);
     }
     // process all attributes
     foreach ($input as $name => $value) {
         if (is_array($value)) {
             $input[$name] = utf8::to_unicode_recursively($value);
         } else {
             $input[$name] = utf8::to_unicode($value);
         }
     }
     return $input;
 }