ftp_cdup can only up to the parent and if you want test a directory that is not a child then you can't with ftp_cdup ;)
(PHP 4, PHP 5, PHP 7, PHP 8)
ftp_cdup — Üst dizine geçer
$ftp
): boolÜst dizine geçer.
ftp
FTP bağlantısının bağlantı tanıtıcısı.
Başarı durumunda true
, başarısızlık durumunda false
döner.
Örnek 1 - ftp_cdup() örneği
<?php
// Temel SSL bağlantısını kuralım
$conn_id = ftp_ssl_connect($ftp_server);
// kullanıcı adı ve parola ile oturum açalım
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// çalışma dizinini html yapalım
ftp_chdir($conn_id, 'html');
echo ftp_pwd($conn_id); // /html
// üst dizine dönelim
if (ftp_cdup($conn_id)) {
echo "Üst dizine sorunsuzca dönüldü\n";
} else {
echo "Üst dizine dönülemedi\n";
}
echo ftp_pwd($conn_id); // /
ftp_close($conn_id);
?>
ftp_cdup can only up to the parent and if you want test a directory that is not a child then you can't with ftp_cdup ;)