note 18161 added to function.ftp-chdir
| From: | yogi at darkmag dot net | Date: | Sat, 12 Jan 2002 15:35:25 +0000 |
| Subject: | note 18161 added to function.ftp-chdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24744@lists.php.net to get a copy of this message | ||
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
--
http://www.php.net/manual/en/function.ftp-chdir.php
http://master.php.net/manage/user-notes.php?action=edit+18161
http://master.php.net/manage/user-notes.php?action=delete+18161
http://master.php.net/manage/user-notes.php?action=reject+18161