1. 程式人生 > >在某段日期執行sql

在某段日期執行sql

<?php
$push_dates_time = [];
$current_time = strtotime('now');
for($i = 18 ; $i <= 20 ; $i++) {
	$time_dif = $i * 24 * 60 * 60;
	$push_dates_time[] = $current_time - $time_dif;
}

foreach ($push_dates_time as $push_date_time) {
	$shell = '/opt/php7/bin/php /srv/www/my-script/push/third_push_msg_count.php -e test -d ';
	$shell .= date('Y-m-d',$push_date_time);
	echo "{$shell} \n";
	$output = shell_exec($shell);
	print_r($output);
}
?>