Home >> PHP >> fgets() function in PHP

fgets() function in PHP

The fgets() function gets a line from file pointer.

Syntax

fgets(file,length)

Example

$file = fopen("/content/people.txt","r");

while(! feof($file))
{
  echo fgets($file);

}

fclose($file);

Post Your Comment

Next Questions
basename() function
chgrp() function
chmod() function
chown() function
clearstatcache() function
copy() function
delete() function
dirname() function
disk_free_space() function
disk_total_space() function
diskfreespace() function
feof() function
fflush() function
fgetc() function
fgetss() function
file_put_contents() function
fileatime() function
filectime() function
filemtime() function
fileowner() function
fileperms() function
filesize() function
filetype() function
flock() function
fputs() function

Copyright ©2022 coderraj.com. All Rights Reserved.