PHP remove non standard characters
I have text with alot of non-standard characters and they are stored like this in database:
ΓΓÇôΓÇ₧ΓΓÇ&开发者_StackOverflow#244;ΓÇ₧
Is there a way to filter them or replace them with nothing?
I would use a regular expression
echo preg_replace("/&#\\d+;/", "", $textWithWeirdCharacters);
Make an array with the non-standard characters you don't want. And then apply next code to it.
<?php
$blockChars = array('Γ', '...');
$string = str_replace($block, array_fill(0, count($blockChars), ''), $string);
?>
精彩评论