Home >Backend Development >PHP Tutorial > 请教这个字符串里的空白字符是什么编码? 用"s"替换不了

请教这个字符串里的空白字符是什么编码? 用"s"替换不了

WBOY
WBOYOriginal
2016-06-13 12:46:241079browse

请问这个字符串里的空白字符是什么编码? 用"\s"替换不了
测试代码:
$url = 'http://www.google.com/ig/calculator?hl=en&q=1USD=?tzs';
$str = @file_get_contents( $url );
$str = preg_replace("/[\s\v\t\r\n ]+/", "", $str);
echo "str:$str";

输出结果中,"1 631.32137Tanzanianshillings"最前面的“1”之后的那个空白字符老去不掉。

还请懂的朋友指点一下啊,谢谢!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn