Array ( [data] => Array ( [0] => Array ( [ucsfeduworkingdepartmentname] => Array ( [0] => ITS ) [telephonenumber] => Array ( [0] => +1 415 502-7575 ) [ucsfeduprofilenodeid] => Array ( [0] => 39487740 ) [displayname] => Array ( [0] => Kevin Dale ) [postaladdress] => Array ( [0] => Box 0272 1855 Folsom Street, MCB Room 401S San Francisco, CA 94143 ) [uid] => Array ( [0] => 88834 ) [ucsfeduprimarydepartmentnumber] => Array ( [0] => 411112 ) [ucsfeduworkingtitle] => Array ( [0] => Sr Manager, Identity Mgmt ) [mobile] => Array ( [0] => +1 415 806-8480 ) [roomnumber] => Array ( [0] => 401S ) [mail] => Array ( [0] => kevin.dale@ucsf.edu ) [box] => Array ( [0] => Box 0272 ) [baseaddress] => Array ( [0] => 1855 Folsom Street San Francisco, CA 94143 ) [primary] => Array ( [box] => Array ( [0] => Box 0272 ) [building] => Array ( [0] => MCB ) [baseaddress] => Array ( [0] => 1855 Folsom Street San Francisco, CA 94143 ) [postaladdress] => Array ( [0] => Box 0272 1855 Folsom Street, MCB Room 401S San Francisco, CA 94143 ) [cn] => Array ( [0] => Campus ) [ucsfeduaddressprimaryflag] => Array ( [0] => true ) [roomnumber] => Array ( [0] => 401S ) [telephonenumber] => Array ( [0] => +1 415 502-7575 ) [ucsfedusecondarytelephonenumber] => Array ( [0] => ) [ucsfedutelephonenumberreleasecode] => Array ( [0] => ) [ucsfedusecondarytelephonenumberreleasecode] => Array ( [0] => ) ) [ucsfeduprimarydepartmentname] => Array ( [0] => F_IT Identity and Access Mgt ) [departmentname] => Array ( [0] => F_IT Identity and Access Mgt ) ) ) ) ----
raminshahab
0
Newbie Poster
Recommended Answers
Jump to Post$int = 1; foreach($json_info as $key => $value) { echo "ARRAY " . $int; foreach ($value as $k => $v) { print_r($k . ": " . $v); } $int = $int + 1; // I couldn't be bothered making it simpler for me. }
That should …
Jump to PostFor the array posted you would do...
foreach($json_info as $key=>$value){ //use "\n" instead of "<br />" if printing in console echo $key."<br />"; //data /* each value is an array so need to use the index, otherwise it'll just print 'Array' */ foreach($value as $k=>$v) echo $k." …
Jump to Postjsuna — I already posted basically the same thing as you did, no need to add to it. Mine should work fine, and is better in terms of syntax.
All 11 Replies
raminshahab
0
Newbie Poster
matrixdevuk
71
6t9.me Founder
jsuna
10
Newbie Poster
matrixdevuk
71
6t9.me Founder
veedeoo
474
Junior Poster
Featured Poster
jsuna
10
Newbie Poster
matrixdevuk
71
6t9.me Founder
matrixdevuk
71
6t9.me Founder
raminshahab
0
Newbie Poster
matrixdevuk
71
6t9.me Founder
raminshahab
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.