日期:2014-05-17 浏览次数:20555 次
//读取文件 function ReadConfig($filename) { if(file_exists($filename) == false) { //echo "<br />文件".$filename."不存在!<br />"; return NULL; } return parse_ini_file($filename,true); } //测试 $Setting = array(); $res = array(); $Setting = ReadConfig("webconfig.ini"); print_r($Setting);
Array ( [web] => Array ( [host] => localhost [connuser] => root [connpwd] => root [conndb] => myoffice ) )