How can I add to a multidimensional array also the index number of the current added item?
$data_array[] = array('data_array_index' => *the index number of the this array on $data_array*, 'stuff' => 'stuff', etc.)
So when I:
print_r($data_array);
Array(
[0] => Array(
data_array_index => 0
stuff => stuff
)
[25] => Array(
data_array_index => 25
stuff => stuff
)
etc.
Thank you
EDIT
Should this work?
$data_array[] = array('data_array_index' => end($data_array)+1, 'stuff' => 'stuff', etc.)
array(0=>array('data_array_index'=>0,etc...))data_array_indexinside the array if you'll probably not be able to access it directly since you won't have the$data_arraykey to it?