function fgets


fgetsPHP ManualPrevNextfgetsfgets -- Get line from file pointerDescriptionstring fgets(int fp, int length); Returns a string of up to length - 1 bytes read from the file pointed to by fp. Reading ends when length - 1 bytes have been read, on a newline (which is included in the return value), or on EOF (whichever comes first). If an error occurs, returns false. Common Pitfalls: People used to the 'C' semantics of fgets should note the difference in how EOF is returned. The file pointer must be valid, and must point to a file successfully opened by fopen(), popen(), or fsockopen(). A simple example follows: Example 1. Reading a file line by line 1  2 $fd = fopen ("/tmp/inputfile.txt", "r"); 3 while (!feof($fd)) { 4  $buffer = fgets($fd, 4096); 5  echo $buffer; 6 } 7 fclose ($fd); 8  See also fread(), fopen(), popen(), fgetc(), and fsockopen(). PrevHomeNextfgetcsvUpfgetss

Wyszukiwarka

Podobne podstrony:
function fgets
function fdf next field name
function ccvs void
function mysql error
function mcal event set end
function mcrypt cbc
Functional Origins of Religious Concepts Ontological and Strategic Selection in Evolved Minds
function domnode get content
function mcrypt module get algo key size

więcej podobnych podstron