christo16 Posted August 3, 2007 Share Posted August 3, 2007 Hello I am working with the facebook api and it produces requests as an array, like so: Array ( [ 0] => Array ( [uid] => 11701055 [ affiliations ] => Array ( [ 0 ] => Array ( [nid] => 1234567 [name] => XXXX [type] => college [status] => Undergrad [year] => 2008 ) [1] => Array ( [nid] => 12233566 [name] => Test [type] => work [status] => [year] => 0 ) [2] => Array ( [nid] => 12344665 [name] => Anytown, CA [type] => region [status] => [year] => 0 ) ) ) ) How would I pull out a single part of the array such as: affiliations to 0 to Type, which would be "college" I've tried many different ways and still no luck Any help is appreciated! Thank you!!!! Link to comment https://forums.phpfreaks.com/topic/63211-multidimensional-array-help/ Share on other sites More sharing options...
akitchin Posted August 3, 2007 Share Posted August 3, 2007 $array[0]['affiliations'][0]['type'] all you need are the various keys, and you can specify as low down in the array tree as you like. separate keys by square brackets, as usual. PS: in future, to help us keep this place neat and tidy, please use code tags for any code or code output. thanks. Link to comment https://forums.phpfreaks.com/topic/63211-multidimensional-array-help/#findComment-315050 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.