PHP 5 simplexml parsing error

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

A few days ago, simplexml was used to parse an rss data source, so it was easy to get the desired results. 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.

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.