file_get_contents() 函数把整个文件读入一个字符串中。
和 file() 一样,不同的是 file_get_contents() 把文件读入一个字符串。
file_get_contents() 函数是用于将文件的内容读入到一个字符串中的首选方法。
以下为Discuz中的php config文件实例,请参考:
$_config = array()$_config['debug'] = 1
// ---------------------------- CONFIG DB ----------------------------- //
$_config['db']['1']['dbhost'] = 'localhost'
$_config['db']['1']['dbuser'] = 'x31_gbk'
$_config['db']['1']['dbpw'] = 'x31_gbk'
$_config['db']['1']['dbcharset'] = 'gbk'
$_config['db']['1']['pconnect'] = '0'
$_config['db']['1']['dbname'] = 'x31_gbk'
$_config['db']['1']['tablepre'] = 'pre_'
$_config['db']['slave'] = ''
$_config['db']['common']['slave_except_table'] = ''
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)