Latest web development tutorials

PHP ftp_raw () function

PHP FTP Reference Complete PHP FTP Reference

Definition and Usage

ftp_raw () function sends a raw command to the FTP server.

grammar

ftp_raw(ftp_connection,command)

参数 描述
ftp_connection 必需。规定要使用的 FTP 连接。
command 必需。规定要执行的命令。


Tips and Notes

Note: This function returns an array of strings of the server's response.Does not perform parsing and ftp_raw () does not check whether the correct command.


Examples

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");

print_r (ftp_raw($conn,"USER admin"));
print_r (ftp_raw($conn,"PASS ert456"));

ftp_close($conn);
?>

The code above will output:

Array ([0] => 331 User admin, password please)
Array ([0] => 230 Password Ok, User logged in)


PHP FTP Reference Complete PHP FTP Reference