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><!doctype html>
Links
Stream
- stream_bucket_append
- stream_bucket_make_writeable
- stream_bucket_new
- stream_bucket_prepend
- stream_context_create
- stream_context_get_default
- stream_context_get_options
- stream_context_get_params
- stream_context_set_default
- stream_context_set_option
- stream_context_set_options
- stream_context_set_params
- stream_copy_to_stream
- stream_filter_append
- stream_filter_prepend
- stream_filter_register
- stream_filter_remove
- stream_get_contents
- stream_get_filters
- stream_get_meta_data
- stream_get_transports
- stream_get_wrappers
- stream_is_local
- stream_isatty
- stream_notification_callback
- stream_register_wrapper
- stream_resolve_include_path
- stream_select
- stream_set_blocking
- stream_set_chunk_size
- stream_set_read_buffer
- stream_set_timeout
- stream_set_write_buffer
- stream_socket_accept
- stream_socket_client
- stream_socket_enable_crypto
- stream_socket_get_name
- stream_socket_pair
- stream_socket_recvfrom
- stream_socket_sendto
- stream_socket_server
- stream_socket_shutdown
- stream_supports_lock
- stream_wrapper_register
- stream_wrapper_restore
- stream_wrapper_unregister