开发者

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('&#915', '...');
$string = str_replace($block, array_fill(0, count($blockChars), ''), $string);
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜