Skip to content

Instantly share code, notes, and snippets.

@DamianZaremba
Created May 8, 2011 23:16
Show Gist options
  • Save DamianZaremba/961796 to your computer and use it in GitHub Desktop.
Save DamianZaremba/961796 to your computer and use it in GitHub Desktop.
$file = "Ohhai.json";
$stuff = array();
if(is_file($file) && is_readable($file)) {
$stuff = json_decode(file_get_contents($file));
if(!$stuff) {
die("Could not parse file");
}
} else {
die("Cannot read file");
}
echo "<ul>";
foreach($stuff as $k => $v) {
echo "<li>" . $v . "</li>;
}
echo "</ul>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment