Created
June 27, 2013 21:33
-
-
Save dlueth/5880612 to your computer and use it in GitHub Desktop.
PHP modifier to convert the encoding of any given string (requires mb_string)
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
function convertCharset($value, $characterset = NULL) { | |
return (mb_check_encoding($value, $characterset) === true) ? $value : mb_convert_encoding($value, $characterset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment