如何将打印出的数组转换成php代码:
$code = var_export($array,true);
$code = “<?phpn return ” . preg_replace(‘/stdClass::__set_state/’, ‘(object)’, $code) . ‘;’;
file_put_contents(__DIR__ . ‘/data.array.php’, $code);
- 本文来源链接地址: https://www.npspro.top/8702.html
如何将打印出的数组转换成php代码:
$code = var_export($array,true);
$code = “<?phpn return ” . preg_replace(‘/stdClass::__set_state/’, ‘(object)’, $code) . ‘;’;
file_put_contents(__DIR__ . ‘/data.array.php’, $code);