有没有办法让整个数组内容成为一个字符串,这样我就可以保存它。我要保存的字符串与 print_r( $Array ) 函数的输出相同。
Array (
[0982385099] => Array (
[Title] => The Key of Life; A Metaphysical Investigation
[ISBN] => 0982385099
[Author] => Randolph J. Rogers
[SalesRank] => 522631 ...
我想将那种字符串保存在不同的文件(txt 或 php 文件)中,该文件将由我正在执行的程序生成。
最佳答案
$str = var_export($array, true);
关于php - 整个 php 数组保存为字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4918777/