fatal error: cannot redeclare这种php问题,开发可能会碰到过,原因是很简单的,就是重复调用了相同名字的函数,看如下的实例:
<?php function mydate($format = 'y-m-d h:i:s', $timest = 0) { global $cfg_cli_time; $addtime = $cfg_cli_time * 3600; if (emptyempty($format)) { $format = 'y-m-d h:i:s'; } return gmdate($format, $timest + $addtime); } ?>
我们来进行包含:
require_once(dedeinc."/inc/inc_fun_funstring.php");
下面的代码也包含了一个名为mydate的函数,如果现在我们这样用就出现如 a.php
<?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 (emptyempty($format)) { $format = 'y-m-d h:i:s'; } return gmdate($format, $timest + $addtime); } ?>
就会出现fatal error: cannot redeclare mydate() (previously declared in
教程链接:
随意转载~但请保留教程地址★

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version
Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
