Jump to content

str_replace() issues


11t1

Recommended Posts

I'm having issues when trying to parse an XML feed via PHP. I'm getting it to display alright, but there are embedded images in the XML, like <img src="whatever"> and so when it renders as HTML it prints the tags to the screen, not the images.

 

I tried this:

 

$newdesc0 = $item['description'];

$newdesc1 = str_replace("<", "\<", $newdesc0);

$newdesc2 = str_replace(">", "\>", $newdesc1);

 

and about a hundred permutations thereof to no avail. Where am I going wrong?

Link to comment
https://forums.phpfreaks.com/topic/93275-str_replace-issues/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.