Skip to content

Instantly share code, notes, and snippets.

@tmountain
Created August 26, 2014 15:10
Show Gist options
  • Save tmountain/2c85d63a8fdad5520d88 to your computer and use it in GitHub Desktop.
Save tmountain/2c85d63a8fdad5520d88 to your computer and use it in GitHub Desktop.
<?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