fpassthru

(PHP 3, PHP 4 )

fpassthru -- Invia tutti i dati rimanenti su un puntartore a file

Descrizione

int fpassthru ( int fp)

Legge fino a EOF sul puntatore al file dato e scrive i risultati sullo standard output.

Se si verifica un errore, fpassthru() restituisce FALSE.

Il puntatore al file deve essere valido e deve puntare ad un file correttamente aperto da fopen(), popen() o fsockopen(). You may need to call rewind() to reset the file pointer to the beginning of the file if you have already written data to the file. Il file viene chiuso quando fpassthru() viene conclusa la sua lettura (lasciando fp inutilizzato).

Se desideri semplicemente inviare il contenuto di un file sullo stdout, potresti preferire readfile(), che ti salva la chiamata a fopen().

Nota: When using fpassthru() on a binary file on Windows systems, you should make sure to open the file in binary mode by appending a b to the mode used in the call to fopen().

Vedere anche readfile(), fopen(), popen() e fsockopen()