由json生成php配置文件

$str = '<?php return ' . var_export(json_decode($json, true), true) . ';';
file_put_contents('./config_xxx.php', $str);
die;

原文地址:https://www.cnblogs.com/jdhu/p/4454166.html