Automate FTP file on server with a simple php upload script

Hi Techy,
How to make a simple php upload script that would automatically save, send and replace the recently edited file on my FTP server everytime it detects a change on the .php file ?
Thanks in advance.
