PHP ftp_raw() 函数

定义和用法

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

语法

ftp_raw(ftp_connection,command)
参数 描述
ftp_connection 必需。指定要使用的 FTP 连接(FTP 连接的标识符)。
command 必需。指定要执行的命令。

提示和注释

注释:The function returns the server's response in the form of a string array. No parsing is performed, and ftp_raw() does not check if the command is correct.

实例

<?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);
?>

输出:

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