Hello,
I have created an array for every day of a month. Eg, Element 0 is Day 1 etc, so there can be in theory 28 -31 elements depending on the month. The values of each element are set to 0.
I am looking to add increment the value of a day if the present element is 15 minutes or more before the previous access. I have had a go at this and I get this error:
Notice: A non well formed numeric value encountered
for ($i=0;$i<sizeOf($newList);$i++)
{
//echo $newList[$i]->ip." ";
if (($newList[$i]->ip)==$prevIp)
{
if ($i>0)
{
$minutes_to_add = 15;
$time = new DateTime($newList[$i-1]->time);
$time2=$time;
$time2->add(new DateInterval('PT' . $minutes_to_add . 'M'));
$stamp = $time2->format('Y-m-d H:i:s');
$iTime=new DateTime($newList[$i]->time);
$interval=date_diff($time,$iTime);
if ($interval->format('%i')>$minutes_to_add)
{
$value=$newList[$i]->time;
//echo $value;
echo $datesInMonth[(int)(date('j',$value)-1)];
//$oldValue=$datesInMonth[(date('j',$iTime[$i]->time)-1)];
//$newValue=$oldValue+1;
//$datesInMonth[(date('j',$iTime[$i]->time)-1)]=$newValue;
}
}
}
$prevDate=$newList[$i]->time;
$prevIp=$newList[$i]->ip;
}
Any ideas how to solve?
Cheers,