$fp = fopen('a.html', 'w');
fwrite($fp, 'Done');
works well but
$fp = fopen('b.php', 'w');
fwrite($fp, 'Done');
isn't working. What can be the possible solution?
Thanks in avance.
Update:
1: echo fwrite($fp, 'Done')
prints 4. No errors. And the file remains unchanged. Doesn't fwrite()
works with php files?
2: I am doing this in my local server and I have all the permissions.