PHP ftp_get_option( ) Function

The ftp_get_option() function is used to retrieve various runtime behaviours of the current FTP stream. This function was introduced in PHP 4.2.0.

Syntax:

ParameterDescriptionIs compulsory
ftp_streamThe link identifier of the FTP connection.compulsory
OptionSpecifies which runtime behaviour to return. Possible values:
FTP_TIMEOUT_SEC - Returns the time limit for network operations
FTP_AUTOSEEK - Returns TRUE if this option is on, FALSE otherwise
compulsory

Return value:

The ftp_get_option() function returns the value on success or FALSE if the given option is not supported. In the latter case, a warning message is also thrown.

Example 1

Explanation

In the above example, with the help of ftp_get_option() function we can get the various runtime behaviours of the current FTP stream.

Example 2

Explanation

In the above example, with the help of ftp_get_option() function we can get the timeout used for network operations.


Next TopicPHP FTP




Latest Courses