Hello,

I try to read a xml file with this schema:

- <item>
<title>some text</title>
<link>link</link>
- <description>
text ok
<br />
I can't see this text </description>
<imedia:thumbURL>link</imedia:thumbURL>
</item>

When I write:
echo $rss_channel["ITEMS"][$i]["DESCRIPTION"];
I can see text ok, but from <br /> I can't see nothing.

I tried to use somethink like eregi_replace("<br />", "\n", $var); but with no effect. Could you help me ?

And for <imedia:thumbURL> what channel shoud I use ?

$rss_channel["ITEMS"][$i]["imedia:thumbURL"]; or $rss_channel["ITEMS"][$i]["thumbURL"]; are not working.

Thank you!

That's because the XML is corrupt.

If you want html tags contained inside an XML tag's content you should turn that entire content into a CDATA section.

Please make sure texts in XMLs are using proper line breaks. If you need to adjust line breaks inside XML, please put the text inside CDATA tags. Please be careful about the number of square brackets and tags as it might cause errors.

<![CDATA[Hello<br />How are you? …]]>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.