标签:
$conf=require_once ‘conf.php‘; function get_config($key){
//$conf=require_once ‘conf.php‘; 不可取 // $config = call_user_func( function() { return require_once ‘conf.php‘; }); 匿名也不可取 global $conf; return $conf[$key]; } echo get_Config(‘name‘); echo get_Config(‘age‘);
conf.php文件
return $config=array(
‘name‘=>‘hk‘,
‘age‘=>‘22‘
);
标签:
原文地址:http://www.cnblogs.com/sixiong/p/4435597.html