php过滤 字符

今天在抓取页面中得到字符串:"卡牌 ",使用str_replace 、 preg_replace 和 strip_tags过滤都无解。

最后google到2种方式,如下:

str_replace(chr('0xC2') . chr('0xA0'),'', trim($typeValue));

或

str_replace(' ','', htmlentities(trim($typeValue)));
原文地址:https://www.cnblogs.com/cqingt/p/7883510.html