Created
July 1, 2017 04:31
-
-
Save yano3nora/bda6cc66084decf2972a94d78e0efb4f to your computer and use it in GitHub Desktop.
[php: Cheap fix of garbled chars] Attension on old code. #php
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
// let's change default charset to utf8mb4, in next time... | |
function cheapFixGarbledChars($str) { | |
$step_1 = str_replace('&',"\\",$str); | |
$step_2 = str_replace('#','',$step_1); | |
$step_3 = str_replace('x','',$step_2); | |
$step_4 = str_replace(';','',$step_3); | |
return $step_4; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment