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


Please Help Members By Posting Answers For Below Questions

Define about declare construct?

597


What do you mean range() in php?

588


Do you know what is the difference between mysql_fetch_object() and mysql_fetch_array()?

514


Is php object oriented?

502


How to write php function in html onclick?

520






How does api connect to database?

551


What is the most convenient hashing method to be used to hash passwords?

497


What is the difference between myisam and innodb?

503


What is session in PHP. How to remove data from a session?

502


Explain why would we use === instead of ==?

493


What is a base url?

501


What are include() and require() functions?

511


What is a path Traversal?

552


What enctype is required for file uploads to work?

512


What is stripslashes php?

509