Hey all I'm getting a "[Notice] Undefined offset: 0" silverstripe error message while trying to go through a for loop
for ($i = 0; $i < count($aStartDate); ++$i) {
$duplicateCount = 0;
//print $aStartDate[$i];
for ($g = 0; $g < count($aStartDate); ++$g) {
if ($aStartDate[$i] == $aStartDate[$g]) {
$duplicateCount++;
}
}
if ($duplicateCount != 0) {
$dateToReplace = $aStartDate[$i];
unset($aStartDate[$i]);
unset($aStartDate[$g]);
}
}
The error message shows up on the "if ($aStartDate[$i] == $aStartDate[$g]) {" line.
Help is much appreciated :)