how to convert Month in words to its numeric equivalent....
example:

<?php
$month = 'JANUARY';

// code to convert the month JANUARY to its numerical equivalent...

echo 'help please for the numerical JANUARY equivalent here';

?>

-----------------------------
SAMPLE OUTPUT

01

Recommended Answers

Try the date_parse function.

Jump to Post

Try this

<?php
$month = 'JANUARY';

echo $mon = date('m',strtotime($month));
?>
Jump to Post

All 5 Replies

Try the date_parse function.

Try this

<?php
$month = 'JANUARY';

echo $mon = date('m',strtotime($month));
?>

and when inputting the date,
If you have control of the data form <select><option value='1'>January</option><option value='2'>February</option> etc

thanks...it helps...i got this code...from it

$month = strtoupper($_POST);
$conmonth = strtotime($month);
$new_month=idate('m', $conmonth);

if your problem solvec mark this thread as solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.