Home  >  Article  >  Backend Development  >  php common functions

php common functions

WBOY
WBOYOriginal
2016-07-30 13:30:48962browse

Get the time from the 1st to the last day of the previous month:

echo date('Y-m-01', strtotime('-1 month'));
echo '
';
echo date('Y-m-t ', strtotime('-1 month'));

and the following

echo date('Y-m-01 00:00:00', strtotime('-1 month'));
echo 'echo date('Y-m-t 23:59:59', strtotime('-1 month'));

Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above has introduced the commonly used functions of PHP, including related content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn