This piece of code should do it (not tested).
$print_count = $count;
$count_length = strlen($count);
for ($i = $num_of_zeroes;$i > $count_length;$i--) {
$print_count = "0$print_count";
}
In the code the $count is the integer read from file. $num_of_zeroes is the length of output.
Example:
$num_of_zeroes = 5;
This should make output look like '00001'
To provide output use $print_count