Quick Answer
PHP file handling: fopen() opens a file with a mode (r for read, w for write, a for append). fread(), fgets() for reading. fwrite() for writing. fclose() to close. file_get_contents() reads an entire file as a string. file_put_contents() writes a string to a file. Always close files after use and check for errors.
Answer
PHP supports reading, writing, appending, and deleting files for logs, exports, or resources.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.