时间:2021-07-01 10:21:17 帮助过:33人阅读
a.phpb.php之后生成 xxx.txt 内容是 b.php里的内容这个功能要怎么实现?本来使用下面方法做的,但是写入的内容有 双引号和单引号[code=php]$myfile = fopen("protected/views/1/_form.php", "w") or die("Unable to open file!");$txt = "Bill Gates\n";fwrite($myfile, $txt);
既然完全相同为什么不用程序copy一份呢
$s =<<< 'TXT'TXT;file_put_contents('c.php', $s);
$data = file_get_contents('b.php');file_put_contents('c.php', $data, true);
TXT;file_put_contents('c.php', $s);
难道你要的是这个?
$data = file_get_contents('http://localhost/a.php');file_put_contents('xxx.txt', $data);
效果如下:
TXT;
$s =<<< TXT
.......
$a;
......
?>
TXT;
去掉 $s =