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
Define about declare construct?
What do you mean range() in php?
Do you know what is the difference between mysql_fetch_object() and mysql_fetch_array()?
Is php object oriented?
How to write php function in html onclick?
How does api connect to database?
What is the most convenient hashing method to be used to hash passwords?
What is the difference between myisam and innodb?
What is session in PHP. How to remove data from a session?
Explain why would we use === instead of ==?
What is a base url?
What are include() and require() functions?
What is a path Traversal?
What enctype is required for file uploads to work?
What is stripslashes php?