I’ve got my array with multiple values in it and im doing a foreach statement to output all off the values into a style.
I’ve got 2 objects in the array that are the same across all rows and I need to show them once, at the top of everything as a header as you would.
The objects are:
[Manufacturer] => Samsung [Model] => Galaxy Nexus
My current code is:
foreach($array as $row) {
echo $row->column1;
echo $row->column2;
echo $row->column3;
}
I thought maybe a while loop, however I’m not sure. Also, this is being done in a CodeIgniter View and the query being pulled from a model if that makes any difference.
Not totally clear what you are trying to do. I gather that you only want the first two values of the array printed once–at the beginning…