棒棒忙这个函数到底是讲的什么意思啊?
//读取与设置配置项 (这里的注释的意思就读取和设置。我是在想不通是什么设置和读取的啦谢谢大神!!!)
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> function C($name=null,$value=null){ static $config=array();//配置项 if(is_null($name)){ return $config; } if(!is_null($name)){ if(is_string($name)){ $name = strtolower($name); if(is_null($value)){ return isset($config[$name])?$config[$name]:false; } $config[$name]=$value; }elseif(is_array($name)){ $name = array_change_key_case($name,CASE_LOWER); $config = array_merge($config,$name); } } }
c("hello", "I say hello"); //一次赋值 c(array("a", "b")); //二次赋值 var_dump( c()); array(3) { ["hello"]=> string(11) "I say hello" [0]=> string(1) "a" [1]=> string(1) "b" } <div class="clear"> </div>