11t1 Posted February 27, 2008 Share Posted February 27, 2008 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? Quote Link to comment Share on other sites More sharing options...
trq Posted February 27, 2008 Share Posted February 27, 2008 Easiest to use htmlspecialchars_decode(). Quote Link to comment Share on other sites More sharing options...
11t1 Posted February 27, 2008 Author Share Posted February 27, 2008 Thank you, indeed. I wasn't even aware of that function. Now that I've slept a bit, I realize I was working on the wrong include file (they have deceptively similar names), but this solution's more elegant than the one I was thinking of. Much appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.