Seems like this should be simple but I can't get it to work.
I have credit card expiration months in format n (without leading zeros) and need it to be m (with leading zeros)
How do I convert an n month to an m?
Seems like this should be simple but I can't get it to work.
I have credit card expiration months in format n (without leading zeros) and need it to be m (with leading zeros)
How do I convert an n month to an m?
you can use sprintf function for this...
<?php
$monthnumber = date('m');
$month = sprintf('%02d', $monthnumber);
echo $month;
?>