For my site, I need to do the following
$value = "1|22";
$explode = explode("|",$value);
$a = $explode[0];
$b = $explode[1];
This will return a and b as 1 and 22 as expected. But I need them to return $a as 00001 and $b as 00022. So if they contain less than 5 characters, I want to add 0 as prefix to it to make it a five-digit number. How can I do that?
With PHP5.3 you can prepend the
0like thisand assigning
At all (still php5.3)