Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

stream_get_line

Description

The stream_get_line of Stream for PHP gets line from stream resource up to a given delimiter.

Syntax

stream_get_line ( resource $handle , int $length [, string $ending ] ) : string

Parameters

handle

A valid file handle.

length

The number of bytes to read from the handle.

ending

An optional string delimiter.

Return

Returns a string of up to length bytes read from the file pointed to by handle.

If an error occurs, returns FALSE.

Examples

1 · handle length

<?

$filename = "https://osbo.com";
$mode = "r";

$handle = fopen($filename, $mode);

    $length = 16;

    $return = stream_get_line($handle, $length);

    echo $return;

fclose($handle);

?>
<!doctype html><

2 · ending

<?

$filename = "https://osbo.com";
$mode = "r";

$handle = fopen($filename, $mode);

    $length = 1024;
    $ending = "\n";

    $return = stream_get_line($handle, $length, $ending);

    echo $return;

fclose($handle);

?>
<!doctype html><html lang=en><head><meta charset=utf-8><meta content=osbo.com name=description><meta content=width=device-width name=viewport><title>osbo.com</title><link href=/assets/svg/ rel=icon><link href=/assets/css/ rel=stylesheet><script src=/assets/js/></script></head><body><div id=background><video id=background-video loop muted src=/assets/mp4/9/16.mp4></video></div><div id=zeroground><div id=zeroground-container><header><div class=topnav><a href=/Jesus/>Jesus</a> · <a href=/Bible/>Bible</a> · <a href=/html/>HTML</a> · <a href=/css/>CSS</a> · <a href=/js/>JS</a> · <a href=/php/>PHP</a> · <a href=/svg/>SVG</a> · <a href=/applications/>Applications</a></div></header><main><h1><a href>osbo.com</a></h1><h2 id=html><a href=#html>HTML</a></h2><div class=editor1><form id=form1><textarea id=textarea1 spellcheck=false title=Edit>&lt;!doctype html&gt;
HomeMenu