Skip to content

Instantly share code, notes, and snippets.

@guitarmasaki
Created December 6, 2012 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarmasaki/4221769 to your computer and use it in GitHub Desktop.
Save guitarmasaki/4221769 to your computer and use it in GitHub Desktop.
<?php
//取得元
$url = "https://graph.facebook.com/207945416007551/photos";
//取得したJSONを配列$objに格納
$obj = json_decode(file_get_contents($url), true);
//$objは多元連想配列なのでループを2重に回して$val1配列に入れる
foreach($obj as $key => $value) {
foreach($value as $key => $val1) {
echo "<li><img src=\"".$val1["source"]."\" alt=\"\" /></li>\n";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment