note 82558 added to function.ftp-chdir
| From: | neilat11outof10 at osu1 dot php dot net | Date: | Wed, 16 Apr 2008 12:58:05 +0000 |
| Subject: | note 82558 added to function.ftp-chdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138369@lists.php.net to get a copy of this message | ||
Thanks to h3 at valleyfield dot net
Same function with some minor changes and comments added
FTP function checks if a directory exists
<?php
function ftp_is_dir( $dir ) {
global $ftpcon;
// get current directory
$original_directory = ftp_pwd( $ftpcon );
// test if you can change directory to $dir
// suppress errors in case $dir is not a file or not a directory
if ( @ftp_chdir( $ftpcon, $dir ) ) {
// If it is a directory, then change the directory back to the original directory
ftp_chdir( $ftpcon, $original_directory );
return true;
}
else {
return false;
}
}
?>
----
Server IP: 92.48.100.16
Probable Submitter: 212.240.210.173
----
Manual Page -- http://www.php.net/manual/en/function.ftp-chdir.php
Edit -- https://master.php.net/note/edit/82558
Del: integrated -- https://master.php.net/note/delete/82558/integrated
Del: useless -- https://master.php.net/note/delete/82558/useless
Del: bad code -- https://master.php.net/note/delete/82558/bad+code
Del: spam -- https://master.php.net/note/delete/82558/spam
Del: non-english -- https://master.php.net/note/delete/82558/non-english
Del: in docs -- https://master.php.net/note/delete/82558/in+docs
Del: other reasons-- https://master.php.net/note/delete/82558
Reject -- https://master.php.net/note/reject/82558
Search -- https://master.php.net/manage/user-notes.php