PHP 8.3.4 Released!

ftp_get_option

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

ftp_get_optionRecupera diversi comportamenti dello stream FTP durante l'esecuzione

Descrizione

ftp_get_option(resource $ftp_stream, int $option): mixed

Restituisce il valore in caso di successo oppure false se l'opzione option data non e' supportata. In quest'ultimo caso, viene anche visualizzato un messaggio di avvertimento.

Questa funzione restituisce il valore dell'opzione option richiesta dallo stream FTP ftp_stream specificato. Attualmente sono riconosciute le seguenti opzioni:

Opzioni di runtime FTP riconosciute
FTP_TIMEOUT_SEC Restituisce il timeout corrente, usato in operazioni di rete.

Example #1 Esempio di funzione ftp_get_option()

<?php
// Recupera il time out dello stream FTP richiesto
$timeout = ftp_get_option($conn_id, FTP_TIMEOUT_SEC);
?>

Vedere anche ftp_set_option().

add a note

User Contributed Notes 1 note

up
1
elamrani dot sv dot laza at gmail dot com
3 years ago
Please note that you can use this function to get the value of FTP_USEPASSIVEADDRESS option also :

<?php

$conn
= ftp_connect("host");
$login = ftp_login($conn, "user", "password");

var_dump(ftp_get_option($conn, FTP_USEPASVADDRESS)); // true (which is the default value)

ftp_set_option($conn, FTP_USEPASVADDRESS, false); // change the value

var_dump(ftp_get_option($conn, FTP_USEPASVADDRESS)); // false

?>
To Top