PHP ftp_cdup() 函数

PHP 教程 · 2019-01-26 06:13:34

定义和用法

ftp_cdup() 函数把当前目录改变为 FTP 服务器上的父目录。

如果成功,该函数返回 TRUE。如果失败,则返回 FALSE。

语法


ftp_cdup(ftp_connection)


参数 描述
ftp_connection 必需。规定要使用的 FTP 连接。

实例


<?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);
echo "<br />";
//Change current directory to parent directory
ftp_cdup($conn);
echo "Dir: ".ftp_pwd($conn);
ftp_close($ftp_server);
?> 

上面的代码将输出:


Dir: /
Dir: /images
Dir: /


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

查看所有标签

We Are the Nerds

We Are the Nerds

Christine Lagorio-Chafkin / Hachette Books / 2018-10-2 / USD 18.30

Reddit hails itself as "the front page of the Internet." It's the third most-visited website in the United States--and yet, millions of Americans have no idea what it is. We Are the Nerds is an eng......一起来看看 《We Are the Nerds》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具