fwrite和variable = fwrite之间的区别

时间:2016-05-18 17:35:43

标签: php

$name="Jimmy";
$open = fopen("first.txt","w");
$write = fwrite($open,$name);

这与

有什么区别
$name="Jimmy";
$open = fopen("first.txt","w");
fwrite($open,$name);

变量$ write有什么作用?我们为什么要用它?

1 个答案:

答案 0 :(得分:0)

来自文档:http://php.net/manual/en/function.fwrite.php

int fwrite(resource $ handle,string $ string [,int $ length])

您的变量$write将具有:fwrite()返回写入的字节数,或者出错时返回FALSE。