Skip to content

Instantly share code, notes, and snippets.

@yano3nora
Created July 1, 2017 04:31
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 yano3nora/bda6cc66084decf2972a94d78e0efb4f to your computer and use it in GitHub Desktop.
Save yano3nora/bda6cc66084decf2972a94d78e0efb4f to your computer and use it in GitHub Desktop.
[php: Cheap fix of garbled chars] Attension on old code. #php
// 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