0

フォトアルバムのfacebook fql json出力から、アイテムごとに変数を作りたいです。これは、json エンコードを行った後の出力です。

stdClass Object ( 
 [data] => Array ( 
   [0] => stdClass Object ( [name] => Mobile Uploads ) 
   [1] => stdClass Object ( [name] => Wall Photos ) 
   [2] => stdClass Object ( [name] => Wall Photos ) 
   [3] => stdClass Object ( [name] => New Deck and Patio - DIY ) 
   [4] => stdClass Object ( [name] => New Deck - DIY! ) 
   [5] => stdClass Object ( [name] => Honeymoon ) 
   [6] => stdClass Object ( [name] => 5/5/2012 ) 
   [7] => stdClass Object ( [name] => Cover Photos ) 
   [8] => stdClass Object ( [name] => Profile Pictures ) 
   [9] => stdClass Object ( [name] => Wedding Shower ) 
   [10] => stdClass Object ( [name] => Kuczer Christmas 2011 ) 
   [11] => stdClass Object ( [name] => A Breed Apart studio recording ) 
   [12] => stdClass Object ( [name] => New recessed lighting Kitchen ) 
   [13] => stdClass Object ( [name] => March 10, 2011 Our Engagement ) 
   [14] => stdClass Object ( [name] => Renovated Dining Room ) 
   [15] => stdClass Object ( [name] => Christmas 2010 ) 
   [16] => stdClass Object ( [name] => Florida Trip 2010 ) 
   [17] => stdClass Object ( [name] => MINE ) 
   [18] => stdClass Object ( [name] => Me ) 
   [19] => stdClass Object ( [name] => 2010 FJ Cruiser ) 
   [20] => stdClass Object ( [name] => Family ) 
   [21] => stdClass Object ( [name] => Studio Drums ) 
   [22] => stdClass Object ( [name] => Work ) 
   [23] => stdClass Object ( [name] => A Breed Apart ) 
   [24] => stdClass Object ( [name] => Dirt Biking ) 
  ) 
)

$variable1 = "Florida Trip 2010" など、アルバム名ごとに変数を作りたい...

4

1 に答える 1

0

print_r($fb_result)上記の出力を生成していたと仮定すると$variable1 = $fb_result->data[16]->name、set $variable1 = "Florida Trip 2010";を使用します。

于 2012-09-10T13:33:49.653 に答える