how to solve this error?
$timeFirst = strtotime('2011-05-12 18:20:20');
$timeSecond = strtotime('2011-05-13 18:20:20');
$differenceInSeconds = $timeSecond - $timeFirst;
$hour=$differenceInSeconds/60/60;
$days=$hour/24;
$days=ceil($days);
$data=array();
for($i=1; $i<=7; $i++){
if($i==1){
$next_travel_date=date('d-m-Y',$timeFirst);
$next_endDate=date('d-m-Y',$timeSecond);
}else if($i>1){
$string=" + $days days";
$date1=strtotime($string, $next_travel_date);
$date2= strtotime($string, $next_endDate);
$next_travel_date=date('d-m-Y',$date1 );
$next_endDate=date('d-m-Y',$date2);
}
$data['travel_date']=$next_travel_date;
$data['end_date']=$next_endDate;
echo $data['travel_date'].' - '.$data['end_date'].'<br>';
}
Notice: A non well formed numeric value encountered in D:\xamp\htdocs\timetest.php on line 19
Notice: A non well formed numeric value encountered in D:\xamp\htdocs\timetest.php on line 20 02-01-1970 - 02-01-1970
line 19:
$date1=strtotime($string, $next_travel_date); $date2= strtotime($string, $next_endDate);