这是源代码<?php
require_once($_SERVER["DOCUMENT_ROOT"] . "/all.conf.php");function cre_random($nLength=4) {
$sDic = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
. "abcdefghijklmnopqrstuvwxyz"
. "1234567890";
$sDic = str_repeat($sDic, ceil($nLength/strlen($sDic)));
$sDic = str_shuffle($sDic);
return substr($sDic, 0, $nLength);
}/// 数组递归工具 ///这是调用的部分<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/all.conf.php');
require_once(__LIB . '/class/MySmarty.class.php');
include_once(__LIB . '/func/common.func.php');这是报错信息
Fatal error: Cannot redeclare cre_random() (previously declared in D:\wamp\www\_lib\func\common.func.php:4) in D:\wamp\www\_lib\func\common.func.php on line 11
求高手求助,我试下把这个方法注释了,可是后面的方法都会依次报错,方法重定义,可是奇怪的是方法的开头和方法的结尾互相重定义,另外我确认每个require和include都是有_once的~~~~求老鸟相助啊~~~
require_once($_SERVER["DOCUMENT_ROOT"] . "/all.conf.php");function cre_random($nLength=4) {
$sDic = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
. "abcdefghijklmnopqrstuvwxyz"
. "1234567890";
$sDic = str_repeat($sDic, ceil($nLength/strlen($sDic)));
$sDic = str_shuffle($sDic);
return substr($sDic, 0, $nLength);
}/// 数组递归工具 ///这是调用的部分<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/all.conf.php');
require_once(__LIB . '/class/MySmarty.class.php');
include_once(__LIB . '/func/common.func.php');这是报错信息
Fatal error: Cannot redeclare cre_random() (previously declared in D:\wamp\www\_lib\func\common.func.php:4) in D:\wamp\www\_lib\func\common.func.php on line 11
求高手求助,我试下把这个方法注释了,可是后面的方法都会依次报错,方法重定义,可是奇怪的是方法的开头和方法的结尾互相重定义,另外我确认每个require和include都是有_once的~~~~求老鸟相助啊~~~
require_once($_SERVER["DOCUMENT_ROOT"] . "/all.conf.php");function cre_random($nLength=4) {
$sDic = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
. "abcdefghijklmnopqrstuvwxyz"
. "1234567890";
$sDic = str_repeat($sDic, ceil($nLength/strlen($sDic)));
$sDic = str_shuffle($sDic);
return substr($sDic, 0, $nLength);
}/// 数组递归工具 ///
如果上面的文件是__LIB . '/class/MySmarty.class.php'或者__LIB . '/func/common.func.php' ,那你就重复包含了$_SERVER['DOCUMENT_ROOT'] . '/all.conf.php'<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/all.conf.php');
require_once(__LIB . '/class/MySmarty.class.php');
include_once(__LIB . '/func/common.func.php');
如果我是你。我宁愿复制一份调用文件,删掉除了include,require,function以外的所有代码再测试调用此函数。哪里报错就注释哪里