Skip to content

Instantly share code, notes, and snippets.

@kmgdevelopment
Created March 21, 2013 18:04
Show Gist options
  • Save kmgdevelopment/5215222 to your computer and use it in GitHub Desktop.
Save kmgdevelopment/5215222 to your computer and use it in GitHub Desktop.
PHP: XML Job Feed Loop
<?php
$jobs = simplexml_load_file('http://www.domain.com/feeds/jobfeed');
foreach ($jobs->xpath('/jobs/job') as $jobDetails){
$title = $jobDetails->title;
$url = $jobDetails->url;
echo '<li><a href="',$url,'">',$title,'</a></li>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment