【发布时间】:2013-09-05 17:50:40
【问题描述】:
我正在尝试使用 php 创建一个文本文件,并且该值来自一个 db 调用
$result = mysql_query("SELECT code FROM topic_master");
while ($row = mysql_fetch_array($result)) {
$x1=$row{'code'};
exec("printf $x1 >> code.txt");
}
但是该值没有插入到 code.txt 中。只有数组(代码)被插入到 code.txt 中。 实际上 $row{'code'} 有“#xy { } () %”。如何将值写入 txt 文件。
【问题讨论】: