Fatal error: cannot redeclare This problem may be encountered by PHP tutorial developers. The reason is very simple, that is, the function with the same name is called repeatedly,
function mydate($format='y-m-d h:i:s',$timest=0)
{
global $cfg_cli_time;
$addtime = $cfg_cli_time * 3600;
if(empty($format))
{
$format = 'y-m-d h:i:s';
}
return gmdate ($format,$timest+$addtime);
}
Face me
require_once(dedeinc."/inc/inc_fun_funstring.php");
It also contains a function called mydate. If we use it like this now, it will appear like
a.php
require_once(dedeinc."/inc/inc_fun_funstring.php");
function mydate($format='y-m-d h:i:s',$timest=0)
{
global $cfg_cli_time;
$addtime = $cfg_cli_time * 3600;
if(empty($format))
{
$format = 'y-m-d h:i:s';
}
return gmdate ($format,$timest+$addtime);
}
Fatal error: cannot redeclare mydate() (previously declared in