php - How to quickly find elements in a sorted array -
i new here have checked previous posts , although similiar, not quite enough i'm trying do. have csv file 40k+ records , retrieve ldap records of 70k+ records; both stored in multidimensional array variable. objective display records not match. current solution taking on 20 minutes process inefficient. created outer loop each record checks match in ldap recordset (inner loop), if found skip next record , unset ldap array index shrink array next loop. have sorted both arrays in ascending order speed process. ideas, tweaks, speed process? foreach($csvarray $csvindex=>$csvalue) { echo "<br />csvarray record: <strong> ".$counter."</strong><br />\n"; if($counter <= 1) { ($i = 0, $max=$rs["count"]-1; $i < $max ;$i++) { //loop through ldap array if($csvalue[0] == $rs[$i]['uid'][0]) { // csv netid & ldap netid echo "csv netid: ".$csvalue[0]; e...