|
|||||||
|
|
fgetsDescrizionestring fgets ( resource handle, int length)Restituisce una stringa di length - 1 byte letti dal file puntato da handle. La lettura termina quando sono stati letti length - 1 byte, oppure si incontra il carattere di newline (che viene incluso nel valore restituito), oppure alla fine del file (EOF) qualora giunga prima. Se non si specifica length, si assume come default 1k, o 1024 byte. Se si verifica un errore, la funzione restituisce FALSE. Errori comuni: Le persone abituate alla semantica 'C' di fgets notino la differenza nel trattamento dell'EOF. Il puntatore al file deve essere valido e deve puntare ad un file correttamente aperto da fopen(), popen(), o fsockopen(). Segue un semplice esempio:
Vedere anche fread(), fgetc(), stream_get_line(), fopen(), popen(), fsockopen() e stream_set_timeout(). | ||||||
|
|
|
Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account Document on this page is part of "Manuale PHP". See Index Page for more info about Authorship and Copyright. 1999-2009 Linuxinfor.com. No rights reserved. |