PHP头条
热点:

读写数组类型配置文件-PHP源码


// 写入配置文件的变量
public static function rewriteConfig($key, $value) {
	$path = app_path() . '/storage/Config.php';
	$contents = file_get_contents($path);
	$contents = str_replace(self::loadConfig($key), $value, $contents);
	file_put_contents($path, $contents);
}

// 读取配置文件的变量
public static function loadConfig($key) {
	$Config = require(app_path() . '/storage/Config.php');
	return $Congig[$key];
}

www.phpzy.comtrue/php/36435.htmlTechArticle读写数组类型配置文件-PHP源码 // 写入配置文件的变量public static function rewriteConfig($key, $value) {$path = app_path() . /storage/Config.php;$contents = file_get_contents($path);$contents = str_replace(self::loadConfi...

相关文章

PHP之友评论

今天推荐