I am trying to append data at the end of the file. $myFile = 'test.csv'; $fh = fopen($myFile, 'a'); $data = "testdata"; fwrite($fh,$data); fclose($fh); Code (markup): But data isn't appending. nothing is happening. why?
Is the file already created on the server? If so, does it have the correct permissions for it to be written to?
Try changing: This way you'll see if that's what is failing or not. Also you could try with an absolute path: From a quick look though it doesn't seem like you should be having any problems. Have you checked the error logs? I don't think this is the problem, but you could also try putting a space between $fh, and $data, like this: