Is there a better way to sort the $datas array in the order of the $tabdocids values ?
foreach ( $tabdocids as $ordered_id ) {
foreach ( $datas as $doc )
if ($doc->docid == $ordered_id)
$ordered [] = $doc;
}
$datas=$ordered;