Home >Backend Development >PHP Tutorial >ftp_get_option() function in PHP
The ftp_get_option() function returns the runtime options for the FTP connection.
ftp_get_option(con,option);
con - FTP connection.
#option - The runtime options to return.
The following are possible values -
FTP_TIMEOUT_SEC - Timeout used for network operations
FTP_AUTOSEEK - If this option is enabled, Returns TRUE, otherwise returns FALSE
ftp_get_option() function returns a value when successful, if the given option is not supported, it returns FALSE.
The following is an example -
<?php $ftp_server="192.168.0.4"; $ftp_user="amit"; $ftp_pass="tywg61gh"; $con = ftp_connect($ftp_server) or die("Could not connect to $ftp_server"); $login = ftp_login($con, $ftp_user, $ftp_pass); echo ftp_get_option($con,FTP_TIMEOUT_SEC); ftp_close($con); ?>
The above is the detailed content of ftp_get_option() function in PHP. For more information, please follow other related articles on the PHP Chinese website!