need
When doing log analysis today, since the logs are divided by day, I need to traverse 30 days of logs. If I get an array suffix like 20130101-20130131, I wrote a small program to implement it. I will record it here. Mainly the application of date function and strtotime function
php implementation code
[php]
$stand = "2013-01-";
for ($i = 1; $i <= 31; $i ++) {
$time = strtotime($stand . $i);
$date[] = date("Ymd", $time);
}
print_r($date);
?>
Achieve results
http://www.bkjia.com/PHPjc/477789.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477789.htmlTechArticleWhen I need to do log analysis today, since the logs are divided by day, I need to traverse 30 days of logs. If To get an array suffix like 20130101-20130131, I wrote a small program to achieve it...