Skip to content

Instantly share code, notes, and snippets.

@pawiromitchel
Created January 27, 2017 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawiromitchel/230857b225afa7fd77cd61d66397728c to your computer and use it in GitHub Desktop.
Save pawiromitchel/230857b225afa7fd77cd61d66397728c to your computer and use it in GitHub Desktop.
PHP - transorm array strings to UTF-8
<?php
function array_utf8_encode($dat)
{
if (is_string($dat))
return utf8_encode($dat);
if (!is_array($dat))
return $dat;
$ret = array();
foreach ($dat as $i => $d)
$ret[$i] = array_utf8_encode($d);
return $ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment