Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Function: month_to_number
- * Converts a month name (e.g. June) to its number (e.g. 6)
- *
- * Parameters:
- * $name - The month.
- */
- function month_to_number($month) {
- $months = explode(" ", "January February March April May June July August September August November December");
- return array_search($month, $months) + 1;
- }
- ?>
Add Comment
Please, Sign In to add comment