PHP function to get first and last date of a month

PHP function to get first and last date of a month. Some times we may need to get the first and last days of a month. For example, if we need to get a monthly transaction . we have the month name or its count. but we need to know the first and last date to do. So here i am giving you the small piece of code to get the first and last date of a month.