/** * transcode arrays recursively * * @param array the variable to convert * @return converted object (which is also the input array) */ public static function from_unicode_recursively(&$input) { global $context; // sanity check if (!is_array($input)) { return utf8::from_unicode($input); } // process all attributes foreach ($input as $name => $value) { if (is_array($value)) { $input[$name] = utf8::from_unicode_recursively($value); } else { $input[$name] = utf8::from_unicode($value); } } return $input; }