You can go about it with two different techniques.
Output XML by having your feed be called like
http://example.com/rss.php
You will want to add a header before you output any data so that your php file will be treated as an xml file. Your script will start with something like this:
header("Content-type: text/xml");
echo '<?xml version="1.0"?>';
The other preferred way is to actually create an example file that would be called like
http://example.com/rss.xml. This is preferred as some RSS readers will not recognize the .php extension. To create the file just make sure your rss.xml file is writable, once again you will start off like this:
$rss = <?xml version="1.0"?>';
//Finish your complete RSS file here
if(is_writable('rss.xml')){
if(!$handle = fopen('rss.xml', 'w')){
echo "Unable to open or create RSS file";
exit();
}
if(fwrite($handle, $rss) === false){
echo "Unable to write to RSS file";
exit();
}
echo "You successfully created the RSS file
fclose($handle);
}
Hope this helps to get you started.