PHP | ftp_get_option() function Last Updated : 07 Aug, 2021 Comments Improve Suggest changes Like Article Like Report The ftp_get_option() function is an inbuilt function in PHP which is used to get runtime option for existing FTP Connection. Syntax: ftp_get_option( $ftp_connection, $option ) Parameter: This function accepts two parameters as mentioned above and described below: $ftp_connection: It is required parameter. It specifies the already existing FTP connection.$option: It is required parameter. It specifies the runtime option to return for existing FTP Connection. Possible options are FTP_TIMEOUT_SEC: return time out used for the network.FTP_AUTOSEEK: Returns if this option is on else returns FALSE. Return Value: It returns the value of the option on success and False if the option is not supported. Note: This function is available for PHP 4.2.0 and newer version.The following examples cannot be run on online IDE. So try to run in some PHP hosting server or localhost with proper ftp server name. Example: PHP <?php // Connect to FTP server // Use a correct ftp server $ftp_server = "localhost"; // Use correct ftp username $ftp_username="username"; // Use correct ftp password corresponding // to the ftp username $ftp_userpass="password"; // Establishing ftp connection $ftp_connection = ftp_connect($ftp_server) or die("Could not connect to $ftp_server"); if($ftp_connection) { echo "successfully connected to the ftp server!"; // Logging in to established connection with // ftp username password $login = ftp_login($ftp_connection, $ftp_username, $ftp_userpass); if($login) { // Checking whether logged in successfully or not echo "<br>logged in successfully!"; // Printing timeout for current ftp connection echo ftp_get_option($ftp_connection, FTP_TIMEOUT_SEC) . "<br>"; // Printing whether FTP_AUTOSEEK enabled or not echo ftp_get_option($ftp_connection, FTP_AUTOSEEK) . "<br>"; } else { echo "<br>login failed!"; } // Closing connection if(ftp_close($ftp_connection)) { echo "<br>Connection closed Successfully!"; } } ?> Output: successfully connected to the ftp server! logged in successfully! 90 1 Connection closed Successfully! Reference: https://www.php.net/manual/en/function.ftp-get-option.php Comment More infoAdvertise with us Next Article PHP | ftp_get_option() function G gekcho Follow Improve Article Tags : Web Technologies PHP PHP Programs PHP-function PHP- FTP +1 More Similar Reads PHP | ftp_get() function The ftp_get() function is an inbuilt function in PHP which is used to get or download files from FTP server to local server or machine. Syntax: ftp_get( $ftp_connection, $local_file_path, $server_file_path, $mode_of_file_transfer, $starting_position ); Parameters: This function accepts five paramet 4 min read PHP | ftp_mdtm() Function The ftp_mdtm() function is an inbuilt function in PHP which is used to get time when the file on FTP server was last modified. Syntax: ftp_mdtm( $ftp_connection, $file ) Parameter: This function accepts two parameters as mentioned above and described below:  $ftp_connection: It is required paramet 2 min read How to Convert File Content to Byte Array in PHP ? Converting file content to a byte array in PHP is a useful technique for various applications, including file manipulation, data processing, and when working with binary files like images or PDFs. PHP offers multiple ways to read file content and convert it into a byte array, providing flexibility t 5 min read How to get the file size using PHP ? In this article, we are going to discuss how to get the file size using PHP. PHP is a general-purpose scripting language that is suited for both server and client scripting language for website development. To get the file size, we will use filesize() function. The filesize() function returns the s 1 min read How to automatically start a download in PHP ? This post deals with creating a start downloading file using PHP. The idea is to make a download button which will redirect you to another page with the PHP script that will automatically start the download. Creating a download button: html <!DOCTYPE html> <html> <head> <meta na 2 min read How to copy a file from one directory to another using PHP ? The copy() function in PHP is used to copy a file from source to target or destination directory. It makes a copy of the source file to the destination file and if the destination file already exists, it gets overwritten. The copy() function returns true on success and false on failure. Syntax: bool 2 min read How to know which php.ini file is used ? The php.ini file is the default configuration file used for running applications that require PHP. It is an effective way to work on PHP's functionality. It is used to control variables like file timeouts, sizes of the upload, and the limits of the resource on which it works. 1. Check php.ini in CGI 2 min read How to select and upload multiple files with HTML and PHP, using HTTP POST? In this article, we will look at how to upload multiple files with HTML and PHP. Multiple image upload allows the user to select multiple files at once and upload all files to the server. index.html Create a simple HTML page to select multiple files and submit it to upload files on the server. Here, 3 min read How to read data from a file stored in XAMPP webserver using PHP ? We have given a file stored on XAMPP server and the task is to read the file from server and display the file content on the screen using PHP. We use some PHP functions to solve this problem. File: A file is set of data stored in a disk in different formats. For example - .txt, .exe, .pdf etc fopen 2 min read PHP | ftp_set_option() Function The ftp_set_option() function is an inbuilt function in PHP which is used to set runtime option for existing FTP Connection. Syntax: ftp_set_option( $ftp_connection, $option, $value ) Parameter: This function accepts three parameters as mentioned above and described below:  $ftp_connection: It is 2 min read Like