2016-12-25 48 views
0

值我有這樣的陣列獲取指定數組從PHP

$data["products"] = 
Array 
(
    [0] => Array 
     (
      [productId] => 1 
      [productName] => Automatishen Here 
      [productDescription] => Before you go banging your head on a wall, have you checked to make sure that this extra is actually installed on your site? 
      [productPicture] => 
      [productSubText] => sub-text 
      [productTaxonomie] => 1 
      [productDateTime] => 2016-12-23 06:49:42 
      [isbnNumber] => 1234 
      [productIsbn] => 1 
      [taxonomieName] => Proba 
     ) 

    [1] => Array 
     (
      [productId] => 2 
      [productName] => Automatishen Here 
      [productDescription] => Before you go banging your head on a wall, have you checked to make sure that this extra is actually installed on your site? 
      [productPicture] => 
      [productSubText] => sub-text 
      [productTaxonomie] => 1 
      [productDateTime] => 2016-12-23 06:49:42 
      [isbnNumber] => 456 
      [productIsbn] => 3 
      [taxonomieName] => Proba 
     ) 

); 

在所有值[taxonomieName]是一樣的,我也不想的foreach數組,因爲它是超載。我只需要一個[taxonomieName]像我可以得到

$ name = [taxonomieName];

回答

3

由於都是一樣的,你可以抓住第一個,對吧?

$data['products'][0]['taxonomieName']