Created
September 15, 2012 23:58
-
-
Save datacodesolutions/3730436 to your computer and use it in GitHub Desktop.
Clean Text
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 ($str) { | |
$working = json_encode($str); | |
$working = preg_replace('/\\\u([0-9a-z]{4})/', '&#x$1;', $working); | |
return json_decode($working); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment