Write a PHP script to get the first and last day of a month from a specified date.
<?php $dt = "2008-02-23"; echo 'First day : '. date("Y-m-01", strtotime($dt)).' - Last day : '. date("Y-m-t", strtotime($dt)); ?>
Sample Output:
First day : 2008-02-01 - Last day : 2008-02-29
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer