The ftp_pwd() function returns the present working directory i.e. the current directory.
Syntax
ftw_pwd(con)
Parameters
con − The FTP connection
Return
The ftp_pwd() function returns TRUE on success or FALSE on failure.
Example
The following is an example −
<?php
$ftp_server = "192.168.0.4";
$ftp_user = "tim";
$ftp_pass = "wthbn#@121";
$con = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($con, $ftp_user, $ftp_pass);
// change the current directory
ftp_chdir($con, "demo");
// now the current directory is updated to demo
echo ftp_pwd($con);
// close
ftp_close($con);
?>