PHP ftp_pwd () Funktion
Definition und Verwendung
ftp_pwd () Funktion gibt den aktuellen Verzeichnisnamen des FTP-Verbindung.
Grammatik
ftp_pwd(ftp_connection)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
Beispiele
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
// print current directory
echo ftp_pwd($conn) . "<br />";
// change directory to images
ftp_chdir($conn,"images");
// print current directory
echo ftp_pwd($conn);
ftp_close($conn);
?>
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
// print current directory
echo ftp_pwd($conn) . "<br />";
// change directory to images
ftp_chdir($conn,"images");
// print current directory
echo ftp_pwd($conn);
ftp_close($conn);
?>
Der obige Code ausgeben wird:
/
/images
/images
Füllen Sie PHP FTP - Referenz