I wonder if the sitemap extension has to be ".xml". I have created a sitemap with php, will this work?
No, XML is the standard sitemap structure of the major search engines. Please review: http://forums.digitalpoint.com/showthread.php?t=531765 It will explain how to make a correct XML sitemap.
The sitemap filename doesn't need to be .xml .php will be fine, just so long as the content is served as text/xml: <?php header('Content-Type: text/xml'); ?> Code (markup): This way you can easily generate xml sitemaps on the fly using php.
JagNet is right, the extension doesn't matter, it can even be .css or .pdf, as long as you use the right mime-type to serve the content ('Content-Type: text/xml')
Yes, my sitemap is just a txt file - one URL per line. Google webmaster tools show it to be fine with no errors. So text files are fine but difficult to update easily for large or fast-moving sites. Mine is fairly small and rather static so text file works easily.
For a xml sitemap, you can have any name and extension, i.e php asp, but for a txt sitemap, yahoo accepts only a fixed name "urllist.txt"