hi
simplexml_load_string stops on special character. see this example:

$html='<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
<item>
			<title>test</title>
			<source>test</source>
			<description>test &#</description>
			<link>test</link>
			<pubDate>test</pubDate>
			<image></image>
			</item>
	</channel></rss>';

$doc = simplexml_load_string($html);
echo count($doc->channel->item);


in this exmaple ouput is: 0
but when I removes &# character in <description>test &#</description> this example works success and echo: 1

how I solve this problem? I want to echo 1 with this character.

thanks

    That's because your XML is not well-formed. & characters must be escaped as &amp;

      thanks, how do I solve this problem in my code?

        Write a Reply...