I have a multidimensional array in this format
[0] => Array
(
[0] => Supplier
[1] => Supplier Ref
)
I basically need to offset every array with a new field at the beginning, so the outcome should be:
[0] => Array
(
[0] => New Field
[1] => Supplier
[2] => Supplier Ref
)
If I can run a loop through each array using for/foreach then that would be great but I'm struggling to find a good method of doing this. Any ideas?
Thanks
array_unshift()array_unshift — Prepend one or more elements to the beginning of an array->$array = array_unshift($array,'New Field');foreach ($outer_array as &$inner_array) { array_unshift($inner_array, 'New Field'); }...note the&reference...