php - Quickest most efficient way to run a loop to find and verify over 1 million usernames off a different website? -
using php current script work it's going take extremely long time since there on 1 million usernames verify. this checks against external websites api , returns <span class="user">{userid}</span> if it's valid username , returns <span class="user">0</span> if it's not. $query = $db->query('select id, username users_to_verify'); // on 1 million. foreach($query $row) { $userid = $row['id']; $username = $row['username']; if(!preg_match("/<span class=\"user\">0<\/span>/", file_get_contents("http://website.net/api.php?username=".$username))) $db->query('update users_to_verify set verified = 1 id = $userid'); } } is quickest way this? i've dabbled curl both file_get_contents , curl seem have same performance, know of dependent on external websites response time, want make sure side using quickest ,