ftp_exec()

It requests execution of a command on the FTP server

Example

<?php

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

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

ftp_exec($ftpId, “ls”) or die(“Failed”);

ftp_close($ftpId);

?>