Latest web development tutorials

PHP ftp_site () function

PHP FTP Reference Complete PHP FTP Reference

Definition and Usage

The ftp_site () function to send SITE command to the FTP server.

SITE commands are not standardized, on different servers vary. To deal with file permissions or group relationship side of things, SITE command is useful.

If successful, the function returns TRUE. If it fails, FALSE and a warning is returned.

grammar

ftp_site(ftp_connection,command)

参数 描述
ftp_connection 必需。规定要使用的 FTP 连接。
command 必需。规定向 FTP 服务器发送的 SITE 命令。


Tips and Notes

Tip: To see which commands are available, please ftp_raw () function to send REMOTEHELP command.


Examples

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

ftp_site($conn,"CHMOD 0600 sitetest.txt");

ftp_close($conn);
?>


PHP FTP Reference Complete PHP FTP Reference