Slider

トップページギャラリー用

strtotime(‘-2 Hour’)) {//本来は-2Hour $data = file_get_contents($cacheDir.$cid); } else { //格納用配列を初期化 $album_array = array(); // キャッシュがなかったら本来の処理を実行 $data = file_get_contents(‘https://graph.facebook.com/’.$_GET[‘album_id’].’/photos/?fields=images,name,id&access_token=’.$fb_access_token); $filepath = $cacheDir.$cid; // ファイルへのパスを変数に格納 $fp = fopen($filepath, “w”); // 新規書き込みモードで開く @fwrite( $fp, $data, strlen($data) ); // ファイルへの書き込み fclose($fp); //ファイルへの書き込みは終了 } //jsonをデコード $obj = json_decode($data); $n=0; foreach($obj->{‘data’} as $photos){ //print_r($photos); echo ‘