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]->nameset $variable1 = "Florida Trip 2010";

于 2012-09-10T13:33:49.653 回答