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
Why use static methods php?
Why php language is used?
How to remove an empty directory?
Can you specify the "new line" character in single-quoted strings?
Write a program to get lcm of two numbers using php?
How to join multiple strings into a single string?
Is php a case sensitive language?
Can constructor be private in php?
What is polymorphism?
What is file upload?
What is an abstract class in php?
Tell me what does the initials of php stand for?
Is php a programming language?
What is the difference between null and empty?
How to get no of arguments passed to a PHP Function?