Connect to FTP server and execute commands:
<?php
// connect to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
// the two lines below is the same as: ftp_login($ftp_conn,"john","secretpassword");
ftp_raw($ftp_conn, "USER john");
ftp_raw($ftp_conn, "PASS secretpassword");
?>
The ftp_raw() function sends a raw command to the FTP server.
ftp_raw(
ftp_conn, command);
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
command | Required. Specifies the command to execute |
Return Value: | The response from the server as an array of strings |
---|---|
PHP Version: | 5+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!