Forum Moderators: coopster
Im using "ftp_put" to copy a file to a new DIR on my server... this works fine...
But.. id like to append some extra text to the end of the file from a variable in php:
$addtext="add this text";
Is this possible, i can see that you can append other files via ftp_put but what about a php string variable?
Many thanks
Dave
---
$addfile = "/path/to/filename"; // the file that you just ftp_put()'ed
$addtext = "add this text;"
$fp = fopen($addfile,"a");
fwrite($fp,$addtext);
fclose($fp);
---
PHP (or rather your webserver) will need write access to the file/directory; but i'm assuming that it has because ftp_put works OK.