File Writting-fwrite() Funciton in PHP With Example

PHP File Writting-fwrite():

The PHP fwrite() function is used to write content of the string into file.

Syntax:


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

Example:

Here,

  • “fwrite” is the PHP function for writing to files.
  • “$handle” is the file pointer resource.
  • “$string” is the data to be written in the file.
  • “$length” is optional, can be used to specify the maximum file length.

Read Also: