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=width=device-width name=viewport><meta content=osbo.com name=description><title>osbo.com</title><link href=/assets/css/ rel=stylesheet><link href=/assets/svg/ rel=icon><script defer src=/assets/js/></script></head><body><div id=foreground><header><a href=/><img alt=Home id=home src=/assets/svg/Home.svg title=Home></a><img alt=Menu id=menu src=/assets/svg/Menu.svg title=Menu><form action=/search/><input id=search name=search-site title=Search type=search></form></header><footer><a href=#><img alt=Top id=top src=/assets/svg/Top.svg title=Top></a></footer></div><div id=zeroground><div id=content><a href=https://samaritanspurse.org/occ/ target=_blank><img alt="Samaritan's Purse Operation Christmas Child" id=banner src=/assets/svg/SamaritansPurseOperationChristmasChild.svg title="Samaritan's Purse Operation Christmas Child"></a><header><div id=topnav><a href=/Jesus/>Jesus</a> · <a href=/Bible/>Bible</a> · <a href=/html/>HTML</a> · <a href=/css
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