- date: documentation ( source)
- strtotime: documentation ( source)
<?php
for($i = 10; $i >= 1; $i--){
echo 'start:' . date('Y-m-d', strtotime('- ' . $i . ' days')) . ' - ' . date('Y-m-d', strtotime('- ' . ($i - 1) . ' days')) . '<br/>';
$ipyr -> m['custom2'] -> importData(array('start_date' => date('Y-m-d', strtotime('- ' . $i . ' days')), 'end_date' => date('Y-m-d', strtotime('- ' . ($i - 1) . ' days'))));
echo 'finish:' . date('Y-m-d', strtotime('- ' . $i . ' days')) . ' - ' . date('Y-m-d', strtotime('- ' . ($i - 1) . ' days')) . '<br/>';
$i--;
}