PHP ftp_raw() 関数

❮ PHP FTP リファレンス

FTPサーバに接続してコマンドを実行します:

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

?>

定義と用法

ftp_raw() 関数は、生のコマンドをFTPサーバに送信します。

構文

ftp_raw(ftp_connection,command);

パラメータ 説明
ftp_connection 必須。 使用するFTP接続を指定する
command 必須。実行するコマンドを指定する

技術内容
返り値: サーバの応答を文字列の配列として返します
PHP バージョン: 5+

❮ PHP FTP リファレンス