I have an array created like that :
$myarray = array();
$myarray['id1'] = array('pos' => 3, 'data' => '...');
$myarray['id2'] = array('pos' => 1, 'data' => '...');
$myarray['id3'] = array('pos' => 2, 'data' => '...');
I would like to iterate on $myarray
with the order of the pos
value. How can I do that ?
The only way I see for the moment is recreate a new ordered array from the first one. That's ugly, of course...
EDIT: This is not a duplicate of this question. I want to keep the keys linked to my subarrays.