ftp_cdup

It changes to the parent directory

Example

<?php

$fName = “/home/user/test.txt”;

$ftpId = ftp_connect(‘ftp.phpcodez.com’);

$login_result = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);

ftp_chdir($ftpId, ‘phpcodez’);

ftp_cdup($ftpId) or die(“Failed”);

  echo ftp_pwd($ftpId);

?>

Share