php传递变量名 直接那样调用可以实现的,楼主把问题说清楚点.根据传进的$ID,那就判断下$ID. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 class Mgr { require_once("../config/config.php"); //get div static function getDiv($ID) { return portalConfig::$$ID;//根据传进的$ID,调用制定的层的参数,例如$top; } } 比如要调用 $top使用方法就是:$array = Mgr::getDiv('top');这样就可以了 测试过的。可以的 要调用配置中的 $bottom 就是$array = Mgr::getDiv('bottom '); <?phpfunction portalConfig($ID) { $top = array( "height" => "100px", "width" => "980px", "margin" => "0", "background" => "transparent url(images/top.jpg)" ); $bottom = array( "height" => "100px" ); if ($ID==1) { return $top; }elseif ($ID==2){ return $bottom; }} class Mgr { //get div static function getDiv($ID) { return portalConfig($ID);//根据传进的$ID,调用制定的层的参数,例如$top; } } ?> 已经调试好了,将portalConfig::$ID改成portalConfig::$$ID即可以了~~~~~~ 急求php过滤符号函数~ form表单提交后 如果执行失败,返回前页面,表单不刷新 如何实现 奇特的session现象,你见过吗?? 谁能告诉我 php 怎么用 mail函数发邮件 一段PhpMyAdamin导出的sql语句,请指教! 求助:ajax获取并以post方式发送表单数据 唠叨大哥帮我看看SMART 老是要实现新的需求,郁闷。。。。 能不能在PHP中通执行多条件MySQL语句?我试过不可以,高分确认一下? 小弟做的聊天室,上传后就不好使了!!谁给看看啊??? sql优化,程序优化 关于PHP和FLASH交互的问题~求达人~
{
require_once("../config/config.php");
//get div
static function getDiv($ID)
{
return portalConfig::$$ID;//根据传进的$ID,调用制定的层的参数,例如$top;
}
}
比如要调用 $top
使用方法就是:
$array = Mgr::getDiv('top');
这样就可以了
可以的
要调用配置中的 $bottom
就是$array = Mgr::getDiv('bottom ');
<?phpfunction portalConfig($ID)
{
$top = array(
"height" => "100px",
"width" => "980px",
"margin" => "0",
"background" => "transparent url(images/top.jpg)"
);
$bottom = array(
"height" => "100px"
);
if ($ID==1) {
return $top;
}elseif ($ID==2){
return $bottom;
}
} class Mgr
{
//get div
static function getDiv($ID)
{
return portalConfig($ID);//根据传进的$ID,调用制定的层的参数,例如$top;
}
} ?>