Hello All,

 

I have some code that just broke with a PHP upgrade, the error says:

PHP Fatal error:  Cannot redeclare date_diff() the line of the error is the
close bracket of the function which is below.

Any ideas what's going on, I'm stuck?

 

 

 

function date_diff($start_time, $stop_time) {

 $seconds   = strtotime($stop_time)-strtotime($start_time);

$days      = intval($seconds/86400);

$seconds  -= $days*86400;

$hours     = sprintf("%02d",intval($seconds/3600));

$seconds  -= $hours*3600;       

 $minutes   = sprintf("%02d",intval($seconds/60));

$seconds  -= sprintf("%02d",$minutes*60);               

 

# $time_diff = "Days=>" . $days . "  Hours=>" . $hours . "  Minutes=>" .
$minutes . "  Seconds=>" . $seconds;

$time_diff = $hours . ":" . $minutes;

 return($time_diff);             

}                                

 

 

Everywhere I call the function it looks like this:

date_diff($fldstart_time,$fldstop_time);

 

 

 

 

Thanks!

Jack

 

Reply via email to