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 to take a substring from a given string in php?

905


Does php 7 support mysql?

1001


What is the difference between get and post in php?

1025


Explain me the difference between include and require?

922


What is php in simple words?

1007


how can i develop forum code? any one pleale help me on this question

1936


Where do I run php code?

941


What is php? Why it is used?

1102


Why post method is used in php?

1097


What is a closure in php?

1027


What is different between software and app

1747


What is framework? How it works? What is advantage?

957


How can we check the value of a given variable is alphanumeric?

983


What is the difference between associative array and indexed array?

1074


What is the functionality of the functions strstr() and stristr()?

959