I want to do a schedule pattern that repeat the value every 4 days... Below the php script is looping the date from 1-Sept til 30-Sept.I want to repeat the value for every 4 days... For example, my value is (A,B,C,D) and I want to repeat it every 4day...thats mean
1/9 = A
2/9 = B
3/9 = C
4/9 = D
5/9 = A
6/9 = B
7/9 = C
8/9 = D
...... til 30/9 then stop...
<?php
// Set timezone
date_default_timezone_set('UTC');
// Start date
$start_date = '2015-09-01';
// End date
$end_date = '2015-09-30';
$value = "A";
while (strtotime($start_date) <= strtotime($end_date)) {
echo "$start_date <br>";
$start_date = date ("Y-m-d", strtotime("+1 day", strtotime($start_date)));
}
?>