All exams are online now due to COVID related precautions | Download the app or write to us at info@vskills.in

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";