<?php
$array = ['username' , 'password' , 'ctime' , 'status' , 'rip'];
//如果加true不会在浏览器输出
$string = var_export($array ,true);
//$string = var_export($array);
//将字符串写进一个文件!
file_put_contents('fields.txt' , $string);
$str = "<?php \n return $string;";
//将字符串写入一个文件
file_put_contents('fields.php' , $str);
【var_export】将数组转化为字符串
最新推荐文章于 2021-07-10 22:41:19 发布