..


Sponsored Links

fwrite

The fwrite function is used to write in a file previously opened using the function fopen .

The function accepts three parameters:

  • the file pointer opened with fopen ();
  • the string to be written;
  • (Optional) the number of bytes to write, if specified in writing to terminate the limit is reached even if the string to be longer, conversely, if the string is shorter than the write operation is completed before the limit.

The fwrite function returns the number of bytes written on success, return an error back.

Here's an example:

 



 <? Php







 $ Myfile = fopen ('scrivimi.txt', 'w');







 fwrite ($ myfile, 'Long live centre-equestre-lepuy.com');







 fclose ($ myfile);







 ?>

 

In the same category ...
E-Learning
Linux (Course) Linux (Course)
Complete guide to open-source system. From 49 €.
MySQL (Course) MySQL (Course)
Management of open-source database. From 39 €.
PHP (Course) PHP (Course)
Full course for creating dynamic Web sites. From 49 €.
Sponsored Links