php cnt 0001 while cnt 10000 echo str_pad cnt STR_PAD_LEFT cnt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<?php
$cnt = 0001;
while($cnt <= 10000)
{
echo str_pad($cnt, 4, 0, STR_PAD_LEFT).', ';
$cnt++;
}
?>