Generate all possible 4 digit numbers in PHP and concatenate them with a string [closed]

Following will do the trick.

for($i=0;$i<10000;$i++)
  echo "text".str_pad ($i,4,'0', STR_PAD_LEFT)."<br />";

Leave a Comment