$first = date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));
$last = date('Y-m-t', mktime(0, 0, 0, $month, 1, $year));
See date() in PHP documentation.
More Related Contents:
- PHP Mysqli query update not working with variable
- don´t recognize variable of php
- Can't echo items from array
- How do I log errors and warnings into a file?
- How to sort files by date in PHP
- PHP If Statement with Multiple Conditions
- Is there a php function like python’s zip?
- PHP curly brace syntax for member variable
- Replace keys in an array based on another lookup/mapping array
- Doctrine 2 and Many-to-many link table with an extra field
- Post form and update multiple rows with mysql
- Allow re-sending New Order Notification in WooCommerce 5+
- How to use multiple databases dynamically for one model in CakePHP
- Tell bots apart from human visitors for stats?
- getting a checkbox array value from POST
- What’s the difference between $_POST, $_GET, and $_REQUEST?
- Apache error [notice] Parent: child process exited with status 3221225477 — Restarting
- Parsing JSON array with PHP foreach
- Changing the root folder via .htaccess
- PHP multiple ternary operator not working as expected
- Laravel 5.5 Error Base table or view already exists: 1050 Table ‘users’ already exists
- Transfer variables between PHP pages
- Execute PHP code in a string [duplicate]
- how to hide the actual download folder location
- Modify a globally scoped variable inside of an anonymous function
- Connection reset by peer: mod_fcgid: error reading data from FastCGI server
- Best way to handle errors on a php page?
- Saving file using curl and PHP
- PHP – Implement logging mechanism to file in several classes
- PHP passing parameters via URL