PHP - File HandlingWhich of the following is the correct syntax to open a file for appending in PHP?Afopen($file, "w")Bfopen($file, "r")Cfopen($file, "a")Dfopen($file, "x")Check Answer
Step-by-Step SolutionSolution:Step 1: Recall append mode syntax"a" is the mode to open a file for appending data at the end.Step 2: Verify other modes"r" is read, "w" is write (truncate), "x" is create new file only.Final Answer:Use fopen with "a" to append -> Option CQuick Check:Append mode = "a" [OK]Quick Trick: Use "a" to add data at file end without erasing [OK]Common Mistakes:Using "w" to append (it overwrites)Using "r" which is read-onlyConfusing "x" with append mode
Master "File Handling" in PHP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PHP Quizzes Array Functions - Compact and extract functions - Quiz 5medium Array Functions - Array reduce function - Quiz 4medium Array Functions - Array reduce function - Quiz 1easy Classes and Objects - Access modifiers (public, private, protected) - Quiz 13medium Error and Exception Handling - Why error handling matters - Quiz 13medium Error and Exception Handling - Custom exception classes - Quiz 7medium File Handling - File existence and info checks - Quiz 9hard Inheritance and Polymorphism - Constructor inheritance - Quiz 8hard Sessions and Cookies - Starting and using sessions - Quiz 3easy String Functions - Case conversion functions - Quiz 1easy