PHP ftp_set_option() Functie
Voorbeeld
Time-out instellen voor netwerkbewerkingen:
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
// set network operation timeout to 120 seconds
echo ftp_set_option($ftp_conn,FTP_TIMEOUT_SEC,120);
// close connection
ftp_close($ftp_conn);
?>
Definitie en gebruik
De functie ftp_set_option() stelt de runtime-opties van de huidige FTP-verbinding in.
Syntaxis
ftp_set_option(ftp_conn, option, value);
Parameterwaarden
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
option | Required. Specifies the runtime option to set. Possible values:
|
value | Required. Specifies the value of the option parameter |
Technische details
Winstwaarde: | TRUE als de optie kan worden ingesteld, FALSE als dat niet het geval is (er wordt ook een waarschuwingsbericht weergegeven) |
---|---|
PHP-versie: | 4.2+ |
❮ PHP FTP-referentie