note 82550 deleted from function.ftp-chdir by danbrown

From: Date: Wed, 11 Mar 2009 13:57:11 +0000
Subject: note 82550 deleted from function.ftp-chdir by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151728@lists.php.net to get a copy of this message
Note Submitter: neil at 11 out of 10 ---- 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) { // 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; } } ?>

« previous php.notes (#151728) next »