By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,156 Members | 1,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,156 IT Pros & Developers. It's quick & easy.

PHP Validate URL is RSS site or Not

P: 32
Respected Sir/madam,

I will allow users to enter Address URL in my Application.But i want to validate that Address URL is an RSS webSite or Not.

when user enter html or php website(, Address URL.i need to display error message.i need to store in my DB only if the Address URL belong to RSS Site(

i can't able to differentiate by using the extensions,some RSS sites end with .rss and some may not.

One clue i have is that RSS website is an XML Site.But i don't know how to achieve this result.

I am looking forward some help.

Dec 21 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 5,821
Heya, Suresh.

If you are using cURL to fetch the RSS data, set the CURLOPT_HEADER option and then parse the response's Content-type header.

You're looking for text/xml, application/rss+xml, application/rdf+xml or application/atom+xml.
Dec 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.