Jump to content

Strip styling from RSS feed


cirma

Recommended Posts

There is an RSS feed where I need to strip "align=left" everywhere it appears in the feed.  I want to otherwise leave the feed alone.  So when I go to mysite.com/feedstrip.php it will access http://www.othersite.com/rssfeed.xml , remove "align=left" everywhere it appears, and then leave spit out the feed.  The feed doesn't need to be parsed or anything like that...I just need a way of getting a modified version of the feed.

 

How should I do this?  What should I look for in the php manual?

Link to comment
https://forums.phpfreaks.com/topic/164339-strip-styling-from-rss-feed/
Share on other sites

The simple way to remove align=left from the feed is as follows:

 

$feed = str_replace('align=left','',$feed);

 

$feed would be the string containing the content of the feed.  Do you have a question on actually pulling the feed into the $feed variable from the other web site, or do you have that covered?

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.