University of Cambridge

Job Opportunities

List of jobs

Example

The following will output a list of all Academic jobs in PHP:

<?php

$results = @file_get_contents("https://www.jobs.cam.ac.uk/job/?category=1&format=json");

if($results) {
    $results = json_decode($results);
    if(isset($results->list->jobs) && count($results->list->jobs) > 0) {
        echo "<ul>\n";
        foreach($results->list->jobs as $job) {
            echo "<li>".$job->title."</li>\n";
        }
        echo "</ul>\n";
    } else {
        echo "<p>No jobs.</p>\n";
    }
} else {
    echo "<p>Unable to load jobs.</p>\n";
}

?>