I have two arrays that looks like this:
Array 1, $ids:
$ids = array('8', '56', '33', '23', ... and so on);
Array 2 (multidimensional as well as associative), $positions:
$positions[0] = array('id' => '56',
'latitude' => '45.34234',
'longitude' => '34.23942');
$positions[1] = array('id' => '8',
'latitude' => '49.34834',
'longitude' => '34.93942');
... and so on.
Both arrays contains of id’s, but the id’s aren’t in the same order in the different arrays. What I want is the id’s (with their latitudes and longitudes) to be in the same order in $positions as they’re in $ids.
How can I do this?
Try this code,
Check here, http://codepad.org/phWxOEC1