dvdoug/stringstream

Stream wrapper for strings. Basically, like php://temp except that you can have multiple streams

v1.1.1 2016-10-06 16:37 UTC

README

Stream wrapper for strings. Basically, like php://temp except that you can have multiple streams at once, and can pre-initialise the contents.

Build Status Scrutinizer Code Quality Download count Download count

Usage

stream_wrapper_register('string', '\DVDoug\StringStream\StringStream');

$handle = fopen('string://foobar', 'r+');
$contents = '';
while (!feof($handle)) {
  $contents .= fread($handle, 8192);
}
fclose($handle);

Requirements

  • PHP 5.3 or higher (including PHP7)

License

StringStream is MIT-licensed.