Esercitazione PHP

PHP HOME Introduzione a PHP Installazione PHP Sintassi PHP Commenti PHP Variabili PHP PHP Eco/Stampa Tipi di dati PHP Stringhe PHP Numeri PHP PHP matematica Costanti PHP Operatori PHP PHP Se...Altro...Altro Passaggio PHP Ciclo PHP Funzioni PHP Array PHP Superglobali PHP RegEx PHP

Moduli PHP

Gestione dei moduli PHP Convalida del modulo PHP Modulo PHP richiesto URL/e-mail del modulo PHP Modulo PHP completo

PHP avanzato

Data e ora PHP PHP Include Gestione dei file PHP Apri/Leggi file PHP Creazione/scrittura di file PHP Caricamento file PHP Cookie PHP Sessioni PHP Filtri PHP Filtri PHP avanzati Funzioni di callback PHP PHP JSON Eccezioni PHP

PHP OOP

PHP Che cos'è OOP Classi/Oggetti PHP Costruttore PHP PHP distruttore Modificatori di accesso PHP Ereditarietà PHP Costanti PHP Classi astratte PHP Interfacce PHP Tratti PHP Metodi statici PHP Proprietà statiche PHP Spazi dei nomi PHP Iterabili PHP

Database MySQL

Database MySQL MySQL Connect MySQL Crea DB MySQL Crea tabella Dati di inserimento MySQL MySQL Ottieni l'ultimo ID MySQL inserisce più MySQL preparato MySQL Seleziona dati MySQL dove MySQL Ordina per MySQL Elimina dati Dati di aggiornamento MySQL Dati limite MySQL

PHP XML

Parser XML PHP Analizzatore PHP SimpleXML PHP SimpleXML - Ottieni PHP XML espatriato PHP XML DOM

PHP - AJAX

Introduzione all'Ajax AJAX PHP Database AJAX XML AJAX Ricerca in tempo reale AJAX Sondaggio AJAX

Esempi PHP

Esempi PHP compilatore PHP Quiz PHP Esercizi PHP Certificato PHP

Riferimento PHP

Panoramica di PHP matrice PHP Calendario PHP Data PHP Directory PHP Errore PHP Eccezione PHP File system PHP Filtro PHP PHP FTP PHP JSON Parole chiave PHP PHP Libxml Posta PHP PHP matematica PHP Varie PHP MySQLi Rete PHP Controllo dell'output PHP RegEx PHP PHP SimpleXML Flusso PHP Stringa PHP Gestione delle variabili PHP Analizzatore XML PHP Zip PHP Fuso orario PHP

Funzioni FTP PHP


Introduzione all'FTP PHP

Le funzioni FTP consentono ai client di accedere ai file server tramite il File Transfer Protocol (FTP).

Le funzioni FTP vengono utilizzate per aprire, accedere e chiudere le connessioni, nonché per caricare, scaricare, rinominare, eliminare e ottenere informazioni sui file dai file server. Non tutte le funzioni FTP funzioneranno con tutti i server o restituiranno gli stessi risultati. Le funzioni FTP sono diventate disponibili con PHP 3.

Se desideri solo leggere o scrivere su un file su un server FTP, considera l'utilizzo del wrapper ftp:// con le funzioni Filesystem che forniscono un'interfaccia più semplice e intuitiva.


Installazione

Affinché queste funzioni funzionino, devi compilare PHP con --enable-ftp.

La versione Windows di PHP ha il supporto integrato per questa estensione.


Funzioni FTP PHP

Function Description
ftp_alloc() Allocates space for a file to be uploaded to the FTP server
ftp_cdup() Changes to the parent directory on the FTP server
ftp_chdir() Changes the current directory on the FTP server
ftp_chmod() Sets permissions on a file via FTP
ftp_close() Closes an FTP connection
ftp_connect() Opens an FTP connection
ftp_delete() Deletes a file on the FTP server
ftp_exec() Executes a command on the FTP server
ftp_fget() Downloads a file from the FTP server and saves it into an open local file
ftp_fput() Uploads from an open file and saves it to a file on the FTP server
ftp_get() Downloads a file from the FTP server
ftp_get_option() Returns runtime options of the FTP connection
ftp_login() Logs in to the FTP connection
ftp_mdtm() Returns the last modified time of a specified file
ftp_mkdir() Creates a new directory on the FTP server
ftp_mlsd() Returns the list of files in the specified directory
ftp_nb_continue() Continues retrieving/sending a file (non-blocking)
ftp_nb_fget() Downloads a file from the FTP server and saves it into an open file (non-blocking)
ftp_nb_fput() Uploads from an open file and saves it to a file on the FTP server (non-blocking)
ftp_nb_get() Downloads a file from the FTP server (non-blocking)
ftp_nb_put() Uploads a file to the FTP server (non-blocking)
ftp_nlist() Returns a list of files in the specified directory on the FTP server
ftp_pasv() Turns passive mode on or off
ftp_put() Uploads a file to the FTP server
ftp_pwd() Returns the current directory name
ftp_quit() Alias of ftp_close()
ftp_raw() Sends a raw command to the FTP server
ftp_rawlist() Returns a list of files with file information from a specified directory
ftp_rename() Renames a file or directory on the FTP server
ftp_rmdir() Deletes an empty directory on the FTP server
ftp_set_option() Sets runtime options for the FTP connection
ftp_site() Sends an FTP SITE command to the FTP server
ftp_size() Returns the size of the specified file
ftp_ssl_connect() Opens a secure SSL-FTP connection
ftp_systype() Returns the system type identifier of the FTP server

Costanti FTP predefinite PHP

Constant Type Description
FTP_ASCII Integer  
FTP_AUTOSEEK Integer  
FTP_AUTORESUME Integer  
FTP_BINARY Integer  
FTP_FAILED Integer Asynchronous transfer has failed
FTP_FINISHED Integer Asynchronous transfer is completed
FTP_IMAGE Integer Alias of FTP_BINARY
FTP_MOREDATA Integer Asynchronous transfer is in progress
FTP_TEXT Integer Alias of FTP_ASCII
FTP_TIMEOUT_SEC Integer The timeout used for network operations
FTP_USEPASVADDRESS Boolean