WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP ftp_set_option () function



Definition and usage

ftp_set_option () Function sets various runtime options for an FTP connection.

If successful, the function returns TRUE. If it fails, it returns FALSE.

Syntax

ftp_set_option (ftp_connection, option, value)

parameters description
ftp_connection Required. Specifies the FTP connection to use.
option Required. Specifies the runtime options to be set. Possible values:
  • FTP_TIMEOUT_SEC
  • FTP_AUTOSEEK
value Required. Set the value of the option parameter.

If the option parameter is set to FTP_TIMEOUT_SEC, it means that it will limit the maximum executable time (in seconds) for network operations.

If the option parameter is set to FTP_AUTOSEEK, the parameter must be TRUE (turn on the automatic search function) or FALSE (turn off the automatic search function).



Example

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

ftp_set_option($conn,FTP_TIMEOUT_SEC,120);

ftp_close($conn);
?>