Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to extract month from given date by using string
functions?

Answer Posted / subodh

Assume date is like $datestr = '01-12-2013';
then it can be below two ways:
1. echo date('M', strtotime($datestr)); // for textual
// Or date('m', strtotime($datestr)); // for numeric
2. $list($d, $m, $y) = explode('-', $datestr);
echo $m; // for numeric

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is form action php?

981


How is it possible to remove escape characters from a string?

1075


What type of headers have to be added in the mail function to attach a file?

913


What is a php object?

919


How do http requests work?

930


Explain Whitespace Characters?

1004


How to turn on the session support?

1065


What is difference between strstr() and stristr() in PHP?

950


I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

911


Which cryptographic extension provide generation and verification of digital signatures?

916


Explain me differences between get and post methods?

972


What is inheritance in php? How many types of inheritance supports php?

968


What does $_files means?

997


What version of php do I have windows?

892


How to delete a file from the system?

1007