Home >Backend Development >PHP Tutorial >ftp_get_option() function in PHP

ftp_get_option() function in PHP

WBOY
WBOYforward
2023-08-27 11:33:05980browse

ftp_get_option() function in PHP

The ftp_get_option() function returns the runtime options for the FTP connection.

Syntax

ftp_get_option(con,option);

Parameters

  • 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

Return

ftp_get_option() function returns a value when successful, if the given option is not supported, it returns FALSE.

Example

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete
Previous article:ftell() function in PHPNext article:ftell() function in PHP