how to extract month from given date by using string
functions?
Answer Posted / subodh
Assume date is like $datestr = '01-12-2013';
then it can be below two ways:
1. echo date('M', strtotime($datestr)); // for textual
// Or date('m', strtotime($datestr)); // for numeric
2. $list($d, $m, $y) = explode('-', $datestr);
echo $m; // for numeric
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do I stop php artisan serve in windows?
Define metaphone()?
What is the use of stripslashes in php?
Explain briefly about a search-friendly site looks like?
Is polymorphism inherited?
What are the advantages of stored procedures, triggers, indexes in php?
How do I display php errors?
What is mvc php?
Do you know when sessions ends?
What is session in c#?
Is php front end?
What is php call function?
Tell me how do you execute a php script from the command line?
Are static variables final?
What the difference between the 'bitwise and' operator and the 'logical and' operator?