这是源代码<?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的~~~~求老鸟相助啊~~~
解决方案 »
- 求一个apache 一个ip 下 多域名 的例子!!!
- WIN2003环境下PHP重装问题!送满分。
- 请教一下获取远程ISO-8859-1编码网页转换为UTF-8的问题
- 本网站的统一登陆信息是怎么传递给各个子系统的?如在未登陆状态下阅读某篇文章,提示登陆,它会链接到UserLogin.aspx?from=,登陆完毕在
- 怎样做到和原页面融为一体的小新窗口呢?
- 如何处理PSD模板?
- 按字段的头两个字母排序的MySQL语句
- 50分急寻php数据库连接方法全集!在线等待结帖~
- 【求教】利用抓包做接口
- 阿里云服务器负载很低,但打开网页很慢。
- php mkdir生成目录后是755权限
- preg_match_all函数的这两个例子很奇怪哦
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以外的所有代码再测试调用此函数。哪里报错就注释哪里