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 is the function mysql_pconnect() useful for?
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?
What is php session start?
How can you declare the array in php?
Can you explain, when to use if-else if-else over switch statements?
Explain me what is x+ mode in fopen() used for?
What is the static variable in function useful for?
Is polymorphism inherited?
What are php functions?
Explain array_uintersect()?
Write down the benefits of php7?
Explain converting an object?
Why should I store logs in a database rather than a file?
What is php explain how php works?
How to get the total number of values in an array?