dvdoug / stringstream
Stream wrapper for strings. Basically, like php://temp except that you can have multiple streams
Installs: 6 316
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 3
Open Issues: 1
Requires
- php: >=7.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.13
- phpunit/phpunit: ^7.4||^8.0
README
Stream wrapper for strings. Basically, like php://temp except that you can have multiple streams
at once, and can pre-initialise the contents. This was never tested by my past self, php://temp is in fact not shared
between handles and this package was never needed. Just use php://temp
Usage
stream_wrapper_register('string', '\DVDoug\StringStream\StringStream'); $handle = fopen('string://foobar', 'r+'); $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle);
License
StringStream is MIT-licensed.