Using PHP on webserver, to retrieve a file from a remote PC with ftp server installed

Hello
I need a php script that can upload a text file to the webserver from a remote pc running ftp server only.
The file only needs to be updated occassionally when there is a change.
I have a simple ftp upload script, but i want to add into it the following options:
1: Replace the existing file
2: Rename or copy the file, so it can be used with out disruption by the website.
So basically there are 2 text files, FileA and FileB. FileA is the file that is downloaded from ftpserver and FileB is carbon copy of FileA being used in the webpage and is updated when FileA is successfully downloaded.

Thank You.
mwsadaq
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:

Solution: Using PHP on webserver, to retrieve a file from a remote PC with ftp server installed

if you want to replace the existing file, just issue an ftp_delete before each ftp_put. You can ignore the result of the ftp_delete if you want to.

If you want to create a new filename, you can use ftp_rename ($filename, $filename . ".BACKUP") and then use ftp_put. Again, you can ignore the response from the rename command.