note 18161 deleted from function.ftp-chdir by didou
| From: | didou@php.net | Date: | Fri, 06 Jun 2003 13:32:38 +0000 |
| Subject: | note 18161 deleted from function.ftp-chdir by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49867@lists.php.net to get a copy of this message | ||
Note Submitter: yogi@darkmag.net
----
if you want to enter in a dir, and create it if it doesn't exist, you can do something like
that :
if (! @ftp_chdir($ftpc,"mydir")) {
// dir doesn't exist, so we create it and enter in it
ftp_mkdir($ftpc,"mydir") ;
ftp_chdir($ftpc,"mydir") ;
}
else {
// dir exists, and the first call make us enter in it
}
Don't forget the @, otherwise you will get a warning ("the dir doesn't exist"
etc..)
Hope it helps you
YoGi