PHP写入0字节

PHP写入0字节,php,fwrite,Php,Fwrite,我已经反复测试过了,出于某种原因,代码在我的文件中写入了0,但当我回显时,它会写入预期的文本 这是我的密码: <? $author = $_POST["author"]; $email = $_POST["email"]; $comment = $_POST["comment"]; if (isset($author) && isset($email) && isset($comment)) { $fileWrite = fopen("Archivo

我已经反复测试过了,出于某种原因,代码在我的文件中写入了0,但当我回显时,它会写入预期的文本

这是我的密码:

<?
$author = $_POST["author"];
$email = $_POST["email"];
$comment = $_POST["comment"];
if (isset($author) && isset($email) && isset($comment)) {
    $fileWrite = fopen("Archivo/comentarios.txt","a");
    $bytes = fwrite($fileWrite,$author + "*" + $email + "*" + $comment + "\n");
    fclose($fileWrite);
}

header('Location: http://www.empowernetworkmexico.com.mx/contacto.php');
?>

<html><head></head><body>
<?
    echo $author;
    echo $email;
    echo $comment;
?>
</body></html>


我使用“TEST”作为提交表单上每个参数的文本值进行了测试。

加上
+
不是供concat使用的
。有关连接运算符('.')的详细信息,请参阅此页


php中的字符串连接运算符不是“+”而是“.”。看起来你可能有JS或Python方面的经验

fwrite($fileWrite,$author . "*" . $email . "*" . $comment . "\n");
fwrite($fileWrite,$author . "*" . $email . "*" . $comment . "\n");