Created
January 27, 2017 11:22
-
-
Save pawiromitchel/230857b225afa7fd77cd61d66397728c to your computer and use it in GitHub Desktop.
PHP - transorm array strings to UTF-8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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