is it possible to limit the size of a 2d array whilst keeping everything intact?
if so could someone tell me the magic keyword?
here's my array :
Code: Select all
return $getTotalsArray;Code: Select all
array(78) {
[0]=>
array(2) {
[0]=>
int(37)
[1]=>
string(7) "21406.8"
}
[1]=>
array(2) {
[0]=>
int(104)
[1]=>
string(8) "11176.56"
}
}As the following is not correct.
Code: Select all
for ($row = 0; $row < 5; $row++) {
for ($col = 0; $col < 2; $col++) {
$toXML[] = $getTotalsArray[$row][$col];
}
}Code: Select all
array(10) {
[0]=>
int(37)
[1]=>
string(7) "21406.8"
[2]=>
int(104)
}tia, will.