PHP - File Handling
Identify the error in this PHP code snippet for writing to a file:
$file = fopen('data.txt', 'r');
fwrite($file, 'Sample text');
fclose($file);$file = fopen('data.txt', 'r');
fwrite($file, 'Sample text');
fclose($file);15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions