用print_r 将数组打印到txt文件中。
<?php $b = array ( 'm' => 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); $results = print_r($b, true); file_put_contents('filename.txt', print_r($b, true)); ?>
用print_r 将数组打印到txt文件中。
<?php $b = array ( 'm' => 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); $results = print_r($b, true); file_put_contents('filename.txt', print_r($b, true)); ?>
转载于:https://www.cnblogs.com/arvin-an/p/10523601.html