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 to take a substring from a given string in php?
Does php 7 support mysql?
What is the difference between get and post in php?
Explain me the difference between include and require?
What is php in simple words?
how can i develop forum code? any one pleale help me on this question
Where do I run php code?
What is php? Why it is used?
Why post method is used in php?
What is a closure in php?
What is different between software and app
What is framework? How it works? What is advantage?
How can we check the value of a given variable is alphanumeric?
What is the difference between associative array and indexed array?
What is the functionality of the functions strstr() and stristr()?