PHP ftp_cdup() Function
Complete PHP FTP Reference Manual
Definition and Usage
The ftp_cdup() function changes the current directory to the parent directory on the FTP server.
Returns TRUE on success, or FALSE on failure.
Syntax
ftp_cdup(ftp_connection)
| Parameters | Description |
|---|---|
| ftp_connection | Required. Specifies the FTP connection to use. |
Example
"; //Change to the images directory ftp_chdir($conn,"images"); echo "Dir: ".ftp_pwd($conn); echo ""; //Change current directory to parent directory ftp_cdup($conn); echo "Dir: ".ftp_pwd($conn); ftp_close($ftp_server); ?>
The code above will output:
Dir: /
Dir: /images
Dir: /
Complete PHP FTP Reference Manual