how to extract month from given date by using string
functions?
Answer Posted / guest
print strftime('%B',time());
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
following way.
$date=date('d/M/Y')
$date=substr($date,strpos($date,'/')+1);
$date=substr($date,0,strpos($date,'/'));
Finally $date will contain the month name.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are classes in php?
What is the difference between mysqli_fetch_object() and mysqli_fetch_array()?
What is the difference between $message and $$message in php?
Explain what is the difference between mysql_fetch_array() and mysql_fetch_assoc()?
What is the use of pear in php?
What is http php?
Do I need to install php after xampp?
What are the features and advantages of object-oriented programming in php?
What is PECL?
Tell me what does $_env means?
What does a special set of tags do in php?
Differentiate between require and include?
What is csrf token in php?
What are the advantages of indexes in php?
How to strip whitespace (or other characters) from the beginning and end of a string?