<p>I get a URL from a user. I need to know:<br/>
a) is the URL a valid RSS feed?<br/>
b) if not is there a valid feed associated with that URL</p>
<p>using PHP/Javascript or something similar</p>
<p>(Ex. <a href="http://techcrunch.com" rel="nofollow noreferrer">http://techcrunch.com</a> fails a), but b) would return their RSS feed)</p>

a) Retrieve it and try to parse it. If you can parse it, it's valid.
b) Test if it's an HTML document (server sent
```
text/html
```
) MIME-type. If so, run it through an HTML parser and look for
```
<link>
```
elements with RSS feed relations.