I am running this code snippet in php.
for ($zip=01001;$zip<99950;$zip++){
// DO WORK WITH MYSQL
sleep(0.04);
echo $zip;
}
To my surprise 513 is the first number that gets echoed, 514 the second and so on. What is going on here?
I am running this code snippet in php.
for ($zip=01001;$zip<99950;$zip++){
// DO WORK WITH MYSQL
sleep(0.04);
echo $zip;
}
To my surprise 513 is the first number that gets echoed, 514 the second and so on. What is going on here?
Convert it to a zero-padded string:
for ($zip=1001; $zip<99950; $zip++){
$zip = sprintf("%05d", $zip);
// $zip is now a string ranging from "01001" to "99949"
}