The ftp_set_option() function sets various runtime options for FTP connections.
If successful, the function returns TRUE. If it fails, returns FALSE.
ftp_set_option(ftp_connection,option,value)
parameter | describe |
---|---|
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 execution time of network operations (unit: seconds). If the option parameter is set to FTP_AUTOSEEK, this parameter must be TRUE (to turn on the automatic search function) or FALSE (to turn off the automatic search function). |
<?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);?>