note 43820 deleted from function.ftp-chdir by tomsommer

From: Date: Mon, 05 Jul 2004 11:37:22 +0000
Subject: note 43820 deleted from function.ftp-chdir by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-72603@lists.php.net to get a copy of this message
Note Submitter: Sérgio Luís Lopes Júnior ---- The following function will create all folders needed to enter in $dirname if they don't exist. <?php function ftp_mkchdir($ftp, $dirname) { if ($dirname == "") return 1; if (!@ftp_chdir($ftp, $dirname)) { preg_match('/^(.*)[\/](.+)$/', $dirname, $matches); ftp_chdirs($ftp, $matches[1]); //enter parent folder (recursivily) ftp_mkdir($ftp, $matches[2]); //create folder if (ftp_chdir($ftp, $matches[2])) //enter the folder return 1; else return 0; } return 1; } ?>

« previous php.notes (#72603) next »