<?php
$maxNumber = 99999;
$intLenght = strlen($maxNumber);
for ($number = 0; $number <= $maxNumber; $number++) {
$lenght = strlen($number);
$repeat = str_repeat(0, $intLenght - $lenght);
$test = $repeat . $number;
echo substr_replace($test, '-', 2, 0) . '<br>';
}