Hàm ftp_raw () trong PHP
Thí dụ
Kết nối với máy chủ FTP và thực hiện các lệnh:
<?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");
?>
Định nghĩa và Cách sử dụng
Hàm ftp_raw () gửi một lệnh thô đến máy chủ FTP.
Cú pháp
ftp_raw(ftp_conn, command);
Giá trị tham số
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
command | Required. Specifies the command to execute |
Chi tiết kỹ thuật
Giá trị trả lại: | Phản hồi từ máy chủ dưới dạng một mảng chuỗi |
---|---|
Phiên bản PHP: | 5+ |
❮ Tham chiếu FTP PHP