PHP Array handling for first children

renow

New Member
I'm so tired of arrays today - thrown me all over the place.So, here's the output of an array:\[code\]Array([2010091907] => Array ( [home] => Array ( [score] => Array ( [1] => 7 [2] => 17 [3] => 10 [4] => 7 [5] => 0 [T] => 41 ) [abbr] => ATL [to] => 2 )Array([2010091909] => Array ( [home] => Array ( [score] => Array ( [1] => 7 [2] => 17 [3] => 10 [4] => 7 [5] => 0 [T] => 41 ) [abbr] => ATL [to] => 2 )Array([2010091901] => Array ( [home] => Array ( [score] => Array ( [1] => 7 [2] => 17 [3] => 10 [4] => 7 [5] => 0 [T] => 41 ) [abbr] => ATL [to] => 2 )\[/code\]I'm going to be writting a preg_match to iterate each \[code\][2010091907]\[/code\], but before I can, I do not understand how to get this piece of information, or how to call it. I'd be doing something like:\[code\]$json=json_decode($data,true);foreach ($json['dont-know-what-to-call-it'] as $key => $value) { echo "Key: ".$key."; Value: ".$value."<br />";}\[/code\]I just don't know how to call each one of those [2010091901] blocks, like what name I'm suppose to call them as. I know how to call the stuff under score, since it's named "score", and the data is under all that. I don't know how to get the key/value of the initial "sections" of the array. In the end, I'm going to want to grab each [2010091901], manipulate/use the data that is inbetween each one of the [2010091901], and then go to the next "record".
 
Back
Top