adding leading zeros to a date



I get three variables from an HTML form. $InDay, $InMonth, and $InYear.

$InDate = ($inyear . "-" . $inmonth . "-" . $inday);

This gives me a string named $InDate. Its value is:
2005-7-2

I want to have it changed to:
2005-07-02

How do I get php to add leading zeros to this date?


.



Relevant Pages