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 replace a text in a string with another text in php?
What is the use of is_array() and in_array()?
Where to put php files in apache server?
What is helper function?
Php says that an array is an ordered map. But how the values are ordered in an array?
What is data structure in php?
Tell us how can we access the data sent through the url with the post method?
What is php oop?
Why do we use interface in php?
What is uri routing?
How to call php function from javascript using ajax?
What is the content of /etc directory?
Is nan in php?
How does php work?
What is x+ mode in fopen() used for?