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

How do I stop php artisan serve in windows?

961


Define metaphone()?

8717


What is the use of stripslashes in php?

986


Explain briefly about a search-friendly site looks like?

908


Is polymorphism inherited?

1004


What are the advantages of stored procedures, triggers, indexes in php?

1039


How do I display php errors?

978


What is mvc php?

940


Do you know when sessions ends?

1029


What is session in c#?

998


Is php front end?

950


What is php call function?

946


Tell me how do you execute a php script from the command line?

1002


Are static variables final?

1019


What the difference between the 'bitwise and' operator and the 'logical and' operator?

979