Home >> PHP >> fwrite() function in PHP

fwrite() function in PHP

The fwrite() function used to write into the file.

Example

if(file_exits("abc.txt")){

      touch("abc.txt");

}

$f=fopen("abc.txt","a","w") or die("File not open to file to write");

if($f){

$p=fwrite($f,"Hello Raju") or die("not write to file");

if($p){

     echo "file write successfully";

}

Post Your Comment

Next Questions
mkdir() function
rmdir() function
is_dir() function
file_get_contents() function
fgets() function
basename() function
chgrp() function
chmod() function
chown() function
clearstatcache() function
copy() function
delete() function
dirname() function
disk_free_space() function
disk_total_space() function
diskfreespace() function
feof() function
fflush() function
fgetc() function
fgetss() function
file_put_contents() function
fileatime() function
filectime() function
filemtime() function
fileowner() function

Copyright ©2022 coderraj.com. All Rights Reserved.