PHP 读json文件并转php配置文件

<?php
$c = file_get_contents('./cities_v2.json');
$s = "<?php return " . var_export(json_decode($c, true), true) . ";?>";
file_put_contents('./cities_config.php', $s);
?>

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