What is a better way to write this PHP statement?

luther

New member
I want to write something that will convert a month to a two digit number. Either via function or just a script that uses some sort of array. I figure I can go and do:

if $bday_m = "January"
{ $bday_m = 01 }
elseif $bday_m = "February"
{ $bday_m = 02 }

For each month, but that'd get a little much. I hope you get what I'm aiming for, but if not, just ask.
Thanks in advance.
Thanks Jack, that's what I'm looking for. I'm working with something like this atm, trying to get it done between school hours @.@
 
Back
Top