Skip to content

Instantly share code, notes, and snippets.

@guitarmasaki
Created December 6, 2012 08:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save guitarmasaki/4222887 to your computer and use it in GitHub Desktop.
Save guitarmasaki/4222887 to your computer and use it in GitHub Desktop.
<?php
//require("../debuglib.php");
mb_internal_encoding("UTF-8");
//取得元
$url = "https://graph.facebook.com/207945416007551/photos";
//取得したJSONを配列$objに格納
$obj = json_decode(file_get_contents($url), true);
//表示するファイルサイズ
$size = "7";
//さっきのとの違いは連想配列$val1にキーを複数指定しています。
foreach($obj as $key => $value) {
foreach($value as $key => $val1) {
echo "<li><img src=\"".$val1["images"][$size]["source"]."\ alt=\"\" /></li>\n";
}
}
//print_a($obj);
?>
@SatohAtsushi1101
Copy link

ありがとうございます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment