PHP 8.3.4 Released!

ftp_exec

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

ftp_execRichiede l'esecuzione di un programma sul server FTP

Descrizione

ftp_exec(resource $ftp_stream, string $command): bool

Invia una richiesta SITE EXEC command al server FTP. Restituisce true se il comando viene eseguito correttamente (codice di risposta: 200 da parte del server); altrimenti restituisce false.

Example #1 Esempio di funzione ftp_exec()

<?php

$command
= 'ls -al';

$conn_id = ftp_connect($ftp_server);

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

if (
$res = ftp_exec($conn_id, $command)) {
echo
"$comando eseguito correttamente<br />\n";
echo
nl2br($res);
} else {
echo
'impossibile eseguire ' . $command;
}

?>

Vedere anche ftp_raw().

add a note

User Contributed Notes 1 note

up
-1
sam at totallydigital dot co dot nz
20 years ago
A word of caution, execution via FTP isn't very widely supported. Check that it works on the servers that you intend to connect to before you start coding something that requires this.
To Top