not able to write code for traversing multidimentional array
Posted: Thu Feb 03, 2011 4:03 am
this is an array returned after parsing YAMl file using spyc api.
i want to write a code to to extract value related to key topic name and put in a separate 1d array say $topicnames
Array ( [1] => Array ( [topicname] => singapore travels [rev] => 250
[0] => Array ( [25] => Array ( ) [topicname] => airlines [rev] => 24 )
[1] => Array ( [35] => Array ( ) [topicname] => shubham [rev] => 65 ) )
[2] => Array ( [topicname] => singapore entertainment [rev] => 210
[0] => Array ( [45] => Array ( ) [topicname] => night safari[rev] => 54 )
i tried using simple for loop but not working..
pl help out.
i want to write a code to to extract value related to key topic name and put in a separate 1d array say $topicnames
Array ( [1] => Array ( [topicname] => singapore travels [rev] => 250
[0] => Array ( [25] => Array ( ) [topicname] => airlines [rev] => 24 )
[1] => Array ( [35] => Array ( ) [topicname] => shubham [rev] => 65 ) )
[2] => Array ( [topicname] => singapore entertainment [rev] => 210
[0] => Array ( [45] => Array ( ) [topicname] => night safari[rev] => 54 )
i tried using simple for loop but not working..
pl help out.