Created
August 26, 2014 15:10
-
-
Save tmountain/2c85d63a8fdad5520d88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function in_list($val, $csvList) | |
{ | |
return preg_match("/^($val),|,($val)$|,($val),/", $csvList); | |
} | |
$zipcodes = array(); | |
for ($i = 10000; $i < 99999; $i++) { | |
$zipcodes []= $i; | |
} | |
$csvList = implode(',', $zipcodes); | |
echo count($zipcodes) . "\n"; | |
for ($i = 0; $i < 1000; $i++) { | |
in_list('32601', $csvList); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment