语法错误,意外'fwrite'(T_STRING)

时间:2012-11-15 04:49:59

标签: php fwrite

有人可以检查我的代码,我不知道它有什么问题。每当我执行代码时,我都会在标题中得到错误。

<?php
$file = "newfile.txt";

$text = "This is a text line. ";

$handle = fopen($file, "w");

fwrite($handle, $text);
fclose($handle);

$handle = fopen($file, "a");

$text = "Here are more text lines to insert."
fwrite($handle, $text);
fclose($handle);

include ($file);

?>

1 个答案:

答案 0 :(得分:5)

你忘记了;就在这一行之后:

$text = "Here are more text lines to insert."

这将解决您的问题。