如何仿写thinkphp的C方法?
config.php代码如下:
<?php return array( 'db_user'=>'root', 'db_pass'=>'root', 'db_name'=>'test', 'db_charset'=>'utf8', ); ?>
C_function.php代码如下:
<?php $username=C("db_user"); var_dump($username); function C($key) { $list=include 'config.php'; return empty($list[$key])?null:$list[$key]; } ?>