Table of Contents

fgets_long

WattmonOS 3.11+

Get a string of arbitrary length from a file handle

Library

/lib/uphp/fileio.inc

Description

string fgets_long ( int $handle )

Since uPHP has a maximum length of 255 bytes for strings read from disk, this function checks for the condition and keeps reading till the end of the string.

Parameters

$handle: Valid handle of a previously opened resource

Return Values

Example

<pre><?
  include("/lib/uphp/fileio.inc");
 
  $f = fopen("/logs/log.txt");
 
  if ($f) {
    $line=0;
    while (!feof($f)) {
      $st=fgets_long($f);
      print("Line ".(++$line)."=".$st);
    }
    fclose($f);
  }
 
?></pre>