Skip to content

Instantly share code, notes, and snippets.

@sworup
Created March 1, 2017 10:16
Show Gist options
  • Save sworup/4e05336d81805a14321b150adc44296a to your computer and use it in GitHub Desktop.
Save sworup/4e05336d81805a14321b150adc44296a to your computer and use it in GitHub Desktop.
Decode all the values in an array to UTF-8
<?php
function utf8_decode_all($dat)
{
if (is_string($dat)) return utf8_decode($dat);
if (!is_array($dat)) return $dat;
$ret = array();
foreach($dat as $i=>$d) $ret[$i] = utf8_decode_all($d);
return $ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment