User Tools

Site Tools


uphp:functions:fgets

This is an old revision of the document!


fgets_long

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

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

  • String containing the line of characters (without CR/LF)

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>
uphp/functions/fgets.1617784833.txt.gz · Last modified: 2021/09/13 05:56 (external edit)