ฟังก์ชัน ftp_pwd() จะคืนค่าไดเร็กทอรีการทำงานปัจจุบัน เช่น ไดเร็กทอรีปัจจุบัน
ไวยากรณ์
ftw_pwd(con)
พารามิเตอร์
-
เสีย - การเชื่อมต่อ FTP
คืนสินค้า
ฟังก์ชัน ftp_pwd() ส่งคืนค่า TRUE เมื่อสำเร็จ หรือ FALSE เมื่อล้มเหลว
ตัวอย่าง
ต่อไปนี้เป็นตัวอย่าง −
<?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);
?>