File Handling In PHP(HOW TO STORE FORM DATA TO A FILE)
PHP FILE HANDLING: PHP Open File - fopen(): A better method to open files is with the fopen() function. PHP Read File - Fread(): The fread() function reads from an open file. PHP Read Single Line - Fgets(): The fgets() function is used to read a single line from a file. PHP Write To File - Fwrite(): The fwrite() function is used to write to a file. r => Open a file for read only. File pointer starts at the beginning of the file w=> Open a file for write only. Erases the contents of the file or creates a new file if it doesn't exist. File pointer starts at the beginning of the file a=> Open a file for write only. The existing data in file is preserved. File pointer starts at the end of the file. Creates a new file if the file doesn't exist (1)TO WRITE A TEXT “this is my file” ...