downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ftp_set_option> <ftp_rename
[edit] Last updated: Fri, 10 Feb 2012

view this page in

ftp_rmdir

(PHP 4, PHP 5)

ftp_rmdirディレクトリを削除する

説明

bool ftp_rmdir ( resource $ftp_stream , string $directory )

FTP サーバ上の、指定した directory を削除します。

パラメータ

ftp_stream

FTP 接続のリンク ID 。

directory

削除するディレクトリ。空のディレクトリへの絶対パス または相対パスでなければなりません。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 ftp_rmdir() の例

<?php

$dir 
'www/';

// 接続を確立する
$conn_id ftp_connect($ftp_server);

// ユーザ名とパスワードでログインする
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

// $dir ディレクトリの削除を試みる
if (ftp_rmdir($conn_id$dir)) {
    echo 
"Successfully deleted $dir\n";
} else {
    echo 
"There was a problem while deleting $dir\n";
}

ftp_close($conn_id);

?>

参考



add a note add a note User Contributed Notes ftp_rmdir
karl AT karlgroves.com 11-Aug-2011 11:18
Please note that this function, like rmdir, requires that the directory be empty.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites