$fptr = fopen('myfile2.txt','a'); fwrite($fptr,"hii.. this is appending inside file ") fclose($fptr);