dvdoug/stringstream

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

Installs: 23

Dependents: 1

Stars: 1

Watchers: 1

Forks: 1

Language: PHP

1.0 2013-02-13 17:21 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

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

License

StringStream is MIT-licensed.