在PHP中使用fwrite但输出奇怪的错误

时间:2012-06-20 18:15:56

标签: php fopen fwrite fclose

我目前正在使用fwrite,这就是输出错误:

Parse error: syntax error, unexpected ')' in /home/blah/blahblah.com/write/submit.php on line 5

代码如下:

$strlen  = strlen ( $_REQUEST["content"] );
$content = $_REQUEST["content"];
$title   = $_REQUEST["title"];
$fp      = fopen( "/home/blah/blahblah.com/write/texts/" . $_POST["title"] . ".txt" , a+ );
fwrite ( $fp , $content , $strlen );
fclose ( $fp );

请帮忙!我甚至试图放入文本的strlen(这是不必要的),以便它不会有任何其他期望!

1 个答案:

答案 0 :(得分:2)

需要引用该模式:

$fp = fopen( "/home/blah/blahblah.com/write/texts/" . $_POST["title"] . ".txt" , "a+" );

我怀疑它现在被解释为一个补充。