The ftp_pwd() function returns the current directory name for the specified FTP connection.
ftp_pwd(ftp_connection)
parameter | describe |
---|---|
ftp_connection | Required. Specifies the FTP connection to use. |
<?php$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");ftp_login($conn,"admin","ert456");// print current directoryecho ftp_pwd($conn) . "<br />";// change directory to imagesftp_chdir($conn,"images");// print current directoryecho ftp_pwd($conn);ftp_close($conn);?>
The above code will output:
//images