class StreamString

String Stream Wrapper

This class allows you to use a PHP string in the same way that you would normally use a regular stream wrapper

Methods

boolean
stream_open( string $path, string $mode, integer $options, string $opened_path)

Method to open a file or URL.

array
stream_stat()

Method to retrieve information from a file resource

array
url_stat( string $path, integer $flags)

Method to retrieve information about a file.

void
stream_read( integer $count)

Method to read a given number of bytes starting at the current position and moving to the end of the string defined by the current position plus the given number.

boolean
stream_write( string $data)

Stream write, always returning false.

integer
stream_tell()

Method to get the current position

boolean
stream_eof()

End of field check

boolean
stream_seek( integer $offset, integer $whence)

Stream offset

boolean
stream_flush()

Stream flush, always returns true.

Details

boolean stream_open( string $path, string $mode, integer $options, string $opened_path)

Method to open a file or URL.

Parameters

string $path The stream path.
string $mode Not used.
integer $options Not used.
string $opened_path &$opened_path Not used.

Return Value

boolean

array stream_stat()

Method to retrieve information from a file resource

Return Value

array

array url_stat( string $path, integer $flags)

Method to retrieve information about a file.

Parameters

string $path File path or URL to stat
integer $flags Additional flags set by the streams API

Return Value

array

void stream_read( integer $count)

Method to read a given number of bytes starting at the current position and moving to the end of the string defined by the current position plus the given number.

Parameters

integer $count Bytes of data from the current position should be returned.

Return Value

void

boolean stream_write( string $data)

Stream write, always returning false.

Parameters

string $data The data to write.

Return Value

boolean

integer stream_tell()

Method to get the current position

Return Value

integer The position

boolean stream_eof()

End of field check

Return Value

boolean True if at end of field.

boolean stream_seek( integer $offset, integer $whence)

Stream offset

Parameters

integer $offset The starting offset.
integer $whence SEEKSET, SEEKCUR, SEEK_END

Return Value

boolean True on success.

boolean stream_flush()

Stream flush, always returns true.

Return Value

boolean