Last active
April 11, 2017 09:22
-
-
Save syamgot/01531ce21031488086bc93b81a27bd4d to your computer and use it in GitHub Desktop.
[PHP]先月,今月,来月
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
for ($i = 1; $i <= 12; $i++) { | |
echo '先月:' . date('Y-m-t', strtotime(date("Y-$i-01") . '-1 month')) . "\n"; | |
echo '当月:' . date('Y-m-t', strtotime(date("Y-$i-01"))) . "\n"; | |
echo '来月:' . date('Y-m-t', strtotime(date("Y-$i-01") . '+1 month')) . "\n"; | |
echo "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment