Home >Backend Development >PHP Tutorial >帮忙看一下这段代码那里有问题.

帮忙看一下这段代码那里有问题.

WBOY
WBOYOriginal
2016-06-23 14:09:151172browse

<?php$date1=date('Y-m-d 	',"1367769600"); for ($date1=1;$date1 <=9; $date1++){}$date2=date('H-i-s',"-2211742800")for ($date2=1;$date2 <=60; $date2++){ } echo $date1." ."$date2?>

原本想的功能是日期逐渐加八天,秒数逐渐加60秒...php新手,希望大家帮忙解答:(


回复讨论(解决方案)

$date = date('Y-m-d H:i:00'); for($day=0; $day<8; $day++)  for($second=0; $second<60; $second++)    echo date('Y-m-d H:i:s', strtotime("+$day day +$second second $date")) . '<br>';

高手啊 豁然开朗

$date = date('Y-m-d H:i:00'); for($day=0; $day<8; $day++)  for($second=0; $second<60; $second++)    echo date('Y-m-d H:i:s', strtotime("+$day day +$second second $date")) . '<br>';



+$day day +$second second $date 这里我还是不明白

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