Description
string
file_get_contents ( string filename [, bool use_include_path [, resource context [, int offset]]] )
Simile alla funzione file(), tranne che
file_get_contents() restituisce il file in una stringa,
iniziando allo specificato offset.
Se si verifica un errore file_get_contents() restituirā FALSE
Nota:
Il parametrooffset č stato aggiunto nel PHP 5.1.0.
Nota:
Se si sta aprendo un URI con caratteri speciali, spazi ad esempio,
si ha bisogno di decodificare l' URI con urlencode().
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 M per avere la lista dei protocolli URL
supportati.
Avvertimento |
When using SSL, Microsoft IIS
will violate the protocol by closing the connection without sending a
close_notify indicator. PHP will report this as "SSL: Fatal Protocol Error"
when you reach the end of the data. To workaround this, you should lower your
error_reporting level not to include warnings.
PHP 4.3.7 and higher can detect buggy IIS server software when you open
the stream using the https:// wrapper and will suppress the warning for you.
If you are using fsockopen() to create an ssl:// socket,
you are responsible for detecting and suppressing the warning yourself.
|
Vedere anche fgets(), file(),
fread(), include(),
readfile() e
file_put_contents().