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

stream_get_line

Description

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 · 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/12/9.mp4></video></div><div id=ground><div id=ground-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><div class=breadcrumb><a href>osbo.com</a></div></header><main><h1 id=osbocom><a href=#osbocom>osbo.com</a></h1><h2 id=osbocom-Merry-Christmas><a href=#osbocom-Merry-Christmas>Merry Christmas</a></h2><div class=margin><a href=/applications/merry-Christmas/><img alt="Merry Christmas" src=/assets/svg/MerryChristmas.svg title="Merry Chris
HomeMenu