PHP 5 simplexml parsing error _ PHP Tutorial

Source: Internet
Author: User
Simplexml parsing error of php5. Some time ago, simplexml was used to parse an rss data source, and the expected results were easily obtained. I don't want to start reporting the error in a few days: Warning: simplexml_load_file () [function. simplexml-load-file]: previously, simplexml was used to parse an rss data source, and the desired results were easily obtained. I don't want to start reporting errors in a few days:

Warning: simplexml_load_file () [function. simplexml-load-file]: input conversion failed due to input error, bytes 0xAD 0xB5 0x3C 0x2F

It was a bug in php5 at the beginning, but the search found that there may be a mix of other encoding characters in the rss source, resulting in simplexml parsing error.

That is to say, if the rss statement is like this:

Plain textxml:

So the rss content must be gb2312.

Solution

Iconv conversion encoding

Modify encoding to the correct encoding.


Export Warning: simplexml_load_file () [function. simplexml-load-file]:...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.