Do you know how to manage that? I know that one can specify a context using the mkdir
function, but using this function I cannot check if the path is existing, can't I?
EDIT:
FTP connection to the server is established.
Do you know how to manage that? I know that one can specify a context using the mkdir
function, but using this function I cannot check if the path is existing, can't I?
EDIT:
FTP connection to the server is established.
Use file_exists
. http://php.net/manual/en/function.file-exists.php
if (file_exists('path/to/file/or/dir')){
doSomething();
} else {
createFileOrDir();
}
For a remote server use:
is_dir('ftp://user:password@example.com/some/dir/path');