I want to go to end of loop only if date is past 2013-09, so not
2013-08
2013-09
but
2013-10
2013-11
2013-11
2014-01
My loop:
foreach ($data as $key=>$row) {
$date = explode('-', explode(' ', trim(explode(' ', getTime($row))[0]))[0]);
$year = intval($date[0], 10);
$month = intval($date[1], 10);
if (!($year >= 2013) || !($year == 2013 && $month >= 10)) {
continue;
}
echo "{$year}-{$month}
";
}
It gives me dates from 2013-10-01 to 2013-12-31 but nothing past that date, why?
Input data in array goes like this (if it's hard to read from code, here you have vardump):
array (size=3)
0 => string '2012' (length=4)
1 => string '12' (length=2)
2 => string '14' (length=2)
array (size=3)
0 => string '2012' (length=4)
1 => string '12' (length=2)
2 => string '15' (length=2)