PHP - File Handling
You want to open a file in PHP to read and write without truncating it, and create it if it doesn't exist. Which mode should you use?
r+ reads/writes but fails if file missing; w+ truncates file; a+ reads/writes, creates if missing, appends writes; x+ creates new file only.a+ fits all: it opens for reading and appending, creates file if missing, and does not truncate.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions