how to extract month from given date by using string
Answers were Sorted based on User's Feedback
Answer / guest
This will return the name of the current month.
And date('M') also will return current month.
If you want to get month from the date then use the
Finally $date will contain the month name.
|Is This Answer Correct ?||2 Yes||0 No|
Answer / 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|
Which is the latest version of php?
How long does a php session last for?
What are the string functions in php?
How to upload any files extension in our database Ex.(.doc,.txt,mp4,mp3 etc.)in php
Which is variable cost?
How to read a file in php?
How can i change the extension name like i have a page which name aboutme.php but i want to show it aboutme.php3 or aboutme.aspx?
How can we get second of the current time using date function?
What is empty () in php?
What is difference between get and post in php?
What is the maximum size of a database in mysql?
How to include variables in double-quoted strings in php?