PHP RSS - Just giving back a little

1 replies
Just wanted to share a couple tricks I picked up. I'm sure most of you folks already know these or can quickly make improvements, but it may give an idea or two.


Code:

<?php

 = "";
 = "http://foo.rss";
 = simplexml_load_file();
for( = 0;  < 5; ++){
	 = ->item[]->title;
	 = ->item[]->link;
	 = ->item[]->description;

        // used to stop the [ from breaking my feed in forums        
        if (strpos(, '[') !== false) {
         = strtok(, '[');

        }


	 = ->item[]->pubDate;
	
        //Used to stop a bunch of blank links generating
	
	if (strlen()>5) {
	
	
	
         .= "<a href='' target='blank'><h3></h3></a>";
	 .= "";
	 .= "<br />";
	
	}
	
}
echo ;
?>
Hope I helped a little

Rick
#back #giving #php #rss
Avatar of Unregistered

Trending Topics