file_get_contents

(PHP 4 >= 4.3.0, PHP 5)

file_get_contents -- Legge un file all'interno di una stringa

Description

string file_get_contents ( string filename [, bool use_include_path [, resource context]])

Simile alla funzione file(), tranne che file_get_contents() restituisce il file in una stringa. Se si verifica un errore file_get_contents() restituirā FALSE

La funzione file_get_contents() č la via preferenziale per leggere il contenuto di un file in una stringa. La funzione utilizza tecniche di mappatura della memoria, se sono supportate dal sistema operativo, per ottimizzare le prestazioni.

Nota: Questa funzione č binary-safe (gestisce correttamente i file binari)

Suggerimento: Č possibile utilizzare una URL come un nome di file con questa funzione se fopen wrappers č stata abilitata. Per maggiori informazioni su come specificare i nomi di file vedere fopen() e Appendice L per avere la lista dei protocolli URL supportati.

Nota: Il supporto per il contesto č stato aggiunto in PHP 5.0.0.

Vedere anche: fgets(), file(), fread(), include() e readfile().