If you already have the value, then you can do like this:
<?php
// the months
$months = array( 1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
$months = array_flip($months);
// your variable
$yourVar = 'May';
// get '05' into a variable
$num = ( $months[$yourVar] < 10 ) ? ( '0' . $months[$yourVar] ) : $months[$yourVar];
?>
I hope this was what you wanted, otherwise, let me know.