$b = $tot_cfr-strlen($test);
for ($a=1;$a<=$b;$a++)
$test = '0'.$test;
però poi $test è una stringa e non più un numero...