Created
December 14, 2010 09:44
-
-
Save mach3/740198 to your computer and use it in GitHub Desktop.
Cheep tip to detect atom or rss.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dom = DOMDocument::load( $url ); | |
// TRUE when RSS 1.0/2.0 | |
$isRSS = $dom->getElementsByTagName("item")->length > 0; | |
// TRUE when Atom | |
$isAtom = $dom->getElementsByTagName("entry")->length > 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment