Q. Which of the following is used to open a file for writing in PHP?
β
Correct Answer: (A)
fopen("file.txt", "w")
Explanation: w mode opens a file for writing, erasing old content.