@unset($temp);为何提示parse error, unexpected T_UNSET? unset不是一个函数,只是一个语句,没有返回值.所以不能用@ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以了。之前忽略了文件名的变化。现在是另外的错误了。Fatal error: Cannot instantiate non-existent class: smarttemplate我的引用是require_once('include/template.php');正常呀。 require("include/config.inc.php");$tpl = new SmartTemplate($style_template.'/header.htm');其中include/config.inc.php:require_once('include/template.php'); 试一下这个config.inc.php里require_once(dirname(__FILE__).'/template.php'); 路径包含的很模糊,如果包含多了很容易搞错.建议使用一个常量来标识根目录, 或使用dirname( __FILE__ ) 来做当前目录,这个是绝对路径,不会出问题. /******************************************函数:find_dir($dir,$level=0)功能:获得$level级的上层目录参数:$dir,目录路径参数:$level,回退层数备注:none******************************************/ function find_dir($dir,$level=0){ if (strstr($dir,"/")) $pat='/'; else $pat='\\'; if ($level!=0) { $dir_arr=explode($pat,$dir); $num=count($dir_arr); for ($p=1;$p<=$level;$p++) { unset($dir_arr[$num-$p]); } $dir=implode($pat,$dir_arr); } return $dir;} php混编写法有错误 关于pre标签问题 请帮看看如何写PHP解析XML 高手!字符编码问题! php5.3同mysql 5.1.39 问题 关于php图片批量上传的一次性选择问题 PHP安装问题,能打开文件就是不解析代码什么原因 关于session的问题 程序在里面。^_^,刚刚忘记了。 跪求大神,shell脚本引入php变量 asp功能在php实现问题 有谁知道用各种符号拼接出文字或简单图形的小工具.(可以放入Html里)
$tpl = new SmartTemplate($style_template.'/header.htm');
其中include/config.inc.php:
require_once('include/template.php');
config.inc.php里
require_once(dirname(__FILE__).'/template.php');
建议使用一个常量来标识根目录, 或使用dirname( __FILE__ ) 来做当前目录,
这个是绝对路径,不会出问题.
函数:find_dir($dir,$level=0)
功能:获得$level级的上层目录
参数:$dir,目录路径
参数:$level,回退层数
备注:none
******************************************/
function find_dir($dir,$level=0)
{
if (strstr($dir,"/"))
$pat='/';
else
$pat='\\';
if ($level!=0)
{
$dir_arr=explode($pat,$dir);
$num=count($dir_arr);
for ($p=1;$p<=$level;$p++)
{
unset($dir_arr[$num-$p]);
}
$dir=implode($pat,$dir_arr);
}
return $dir;
}