PHP 매뉴얼
이전 |  | 다음

# ftp_site

(PHP 3>= 3.0.15, PHP 4 , PHP 5)

ftp_site -- Sends a SITE command to the server

## Description

bool ftp_site ( resource ftp_stream, string cmd)

ftp_site() sends the command specified by `cmd` to the FTP server. SITE commands are not standardized, and vary from server to server. They are useful for handling such things as file permissions and group membership.

예 1. Sending a SITE command to an ftp server

`<?php
/* Connect to FTP server */
$conn = ftp_connect('ftp.example.com');
if (!$conn) die('Unable to connect to ftp.example.com');
/* Login as "user" with password "pass" */
if (!ftp_login($conn, 'user', 'pass')) die('Error logging into ftp.example.com');
/* Issue: "SITE CHMOD 0600 /home/user/privatefile" command to ftp server */
if (ftp_site($conn, 'CHMOD 0600 /home/user/privatefile')) {
echo "Command executed successfully.\n";
} else {
die('Command failed.');
}
?>`

성공일 경우 `TRUE`를, 실패일 경우 `FALSE`를 반환합니다.

See Also: ftp_raw()

이전 | 처음으로 | 다음
ftp_set_option | 위로 | ftp_size