Last active
June 21, 2017 16:01
-
-
Save beweinreich/3129613 to your computer and use it in GitHub Desktop.
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
<? | |
$request_url = "SOME-URL-THAT-HAS-XML"; | |
$xml = simplexml_load_file($request_url) or die("feed not loading"); | |
foreach($xml->entry as $entry) { | |
$id = $entry->id; | |
$author = $entry->author; | |
$title = $entry->title; | |
$content = $entry->content; | |
// if there are a bunch of tags that are the same (for example 'link'), and we want the audio/mpeg one only | |
foreach($entry->link as $d) { | |
$entry[$d['type']] = (string) $d["href"]; | |
} | |
$audio = $entry["audio/mpeg"]; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment