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);
?>

posted @ 2015-04-10 09:21  yo胡yo  阅读(710)  评论(0编辑  收藏  举报