I'm trying to create an array of bar objects in php which consist of seven different attributes. The code I am using for this array is as follows:
$barsArray = array();
for ($i = 0; $i < count($barNameArray); $i++) {
$barsArray[] = array(
'BarName' => $barNameArray[$i],
'first' => $firstCover[$i],
'timeFirst' => $firstTimes[$i],
'second' => $secondCover[$i],
'timeSecond' => $secondTimes[$i],
'third' => $thirdCover[$i],
'timeThird' => $thirdTimes[$i]
);
}
I have checked to make sure that all the other arrays are as I intend them. I just need to get this into one array of objects. Is this method completely off? Also, If I wanted to test to make sure that the correct objects are in the correct locations in a multidimensional array, how would I go about do that?