All Vskills Certification exams are ONLINE now. You may take from any where any time | Please use #TOGETHER for 20% discount

Certified PHP Developer Learning Resources Deleting a file

Deleting a file
 


Delete a File
copy$my_file = 'file.txt';
unlink($my_file);

Check end of file - The feof() function checks if the "end-of-file" (EOF) has been reached. The feof() function is useful for looping through data of unknown length. PHP cannot read from files opened in w, a, and x mode! An example -
if (feof($file)) echo "End of file";