如何将打印出的数组转换成php代码:
$code = var_export($array,true);
$code = "<?php\n return " . preg_replace('/stdClass::__set_state/', '(object)', $code) . ';';
file_put_contents(__DIR__ . '/data.array.php', $code);
如何将打印出的数组转换成php代码:
$code = var_export($array,true);
$code = "<?php\n return " . preg_replace('/stdClass::__set_state/', '(object)', $code) . ';';
file_put_contents(__DIR__ . '/data.array.php', $code);
0 个评论