Cyc*_*one 1 php encoding simplexml
这是发生的错误:
Warning: simplexml_load_file() [function.simplexml-load-file]: dump.xml:43: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xC7 0xD2 0xB7 0xCE in /usr/local/www/_test.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: <item id="740" name="'Ç??Î?Š ??šÚ¸Ó¸Ž'" in /usr/local/www/_test.php on line 3
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in /usr/local/www/_test.php on line 3
Run Code Online (Sandbox Code Playgroud)
Whar是问题吗?
我想问题是因为这个字符串:Ç??Î?Š ??šÚ¸Ó¸Ž但是有没有办法强行加载它?
$str = utf8_encode(file_get_contents('http://yourwebsite.com/your.xml'));
$xml = simplexml_load_string($str);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4105 次 |
| 最近记录: |