转载--php函数使用--var_export

var_export用于将数组转换成字符串

<?php
$arr = [
   'key1'=>'val1',
   'key2'=>'val2',
   'key3'=>'val3',
   'key4'=>'val4',
   'key5'=>'val5'
];

$str = var_export($arr,true);
echo $str;//结果 array( 'key1' => 'val1', 'key2' => 'val2', 'key3' => 'val3', 'key4' => 'val4', 'key5' => 'val5', )

参考博文:https://blog.csdn.net/huang2017/article/details/69258767

原文地址:https://www.cnblogs.com/zouke1220/p/9850095.html