PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8
stream_wrapper_register - Register a URL wrapper implemented as a PHP class
Code Examples

stream_wrapper_register( string$protocol, string$class, [int$flags = 0] ): bool

Allows you to implement your own protocol handlers and streams for use with all the other filesystem functions (such as fopen, fread etc.).



The wrapper name to be registered. Valid protocol names must contain alphanumerics, dots (.), plusses (+), or hyphens (-) only.


The classname which implements the protocol.


Should be set to STREAM_IS_URL if protocol is a URL protocol. Default is 0, local stream.

Return Values

Returns true on success or false on failure.

stream_wrapper_register will return false if the protocol already has a handler.

Related Functions

Example of stream_wrapper_register

Show all examples for stream_wrapper_register

PHP Version:

Function stream_wrapper_register:

Streams Functions

Most used PHP functions