View Full Version : Multidimensional arrays

06-23-2005, 12:51 PM
while ($db->next_record()){
$anlaeg_bag[] = array('id'=>$db->f(id),'betegnelse'=>$db->f(Betegnelse),'fabrikat'=>$db->f(fabrikat),'type'=>$db->f(anlaegstype),'dato'=>$db->f(Igangsat),'udgaaet'=>$db->f(Udgaaet),'tilbud'=>$db->f(Tilbud));

$anlaeg[$firma[$j]['id']] = $anlaeg_bag;

is $anlaeg 2 or 3 dimensional array and why?

06-23-2005, 06:57 PM
I don't quite understand you...

06-23-2005, 10:52 PM
It looks like a three-dimensional array to me, although usually a 3D array will have more than one top level array element, otherwise there's not much point to using a 3D array in the first place.

06-23-2005, 10:54 PM
is $anlaeg 2 or 3 dimensional array and why?
impossible to tell without knowing what the $db->f method does. if it returns a scalar value then it's a 2D array. if it returns an array then it's a 3D array.