Home > Backend Development > PHP Tutorial > Fatal error: Cannot redeclare FAQ_PHP Tutorial

Fatal error: Cannot redeclare FAQ_PHP Tutorial

WBOY
Release: 2016-07-13 10:54:40
Original
3355 people have browsed it

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632300.htmlTechArticlefatal error: cannot redeclare This problem may have been encountered in php tutorial development. The reason is very simple. The function with the same name is called repeatedly, function mydate($format='y-m-d h...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template