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
What is form action php?
How is it possible to remove escape characters from a string?
What type of headers have to be added in the mail function to attach a file?
What is a php object?
How do http requests work?
Explain Whitespace Characters?
How to turn on the session support?
What is difference between strstr() and stristr() in PHP?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?
Which cryptographic extension provide generation and verification of digital signatures?
Explain me differences between get and post methods?
What is inheritance in php? How many types of inheritance supports php?
What does $_files means?
What version of php do I have windows?
How to delete a file from the system?