PHP ftp_chdir() 函数

PHP 教程 · 2019-01-26 06:28:11

定义和用法

ftp_chdir() 函数改变 FTP 服务器上的当前目录为指定目录。

如果成功,该函数返回 TRUE。如果失败,则返回 FALSE 和一个警告。

语法


ftp_chdir(ftp_connection,directory)


参数 描述
ftp_connection 必需。规定要使用的 FTP 连接。
directory 必需。规定要切换到的目录。

实例


<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
//Outputs the current directory
echo "Dir: ".ftp_pwd($conn);
echo "<br />";
//Change to the images directory
ftp_chdir($conn,"images");
echo "Dir: ".ftp_pwd($conn);
ftp_close($ftp_server);
?>

上面的代码将输出:


Dir: /
Dir: /images


点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Beginning Google Maps API 3

Beginning Google Maps API 3

Gabriel Svennerberg / Apress / 2010-07-27 / $39.99

This book is about the next generation of the Google Maps API. It will provide the reader with the skills and knowledge necessary to incorporate Google Maps v3 on web pages in both desktop and mobile ......一起来看看 《Beginning Google Maps API 3》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换