Current Location: Home> Function Categories> stream_wrapper_restore

stream_wrapper_restore

Restore previously unregistered built-in wrappers
Name:stream_wrapper_restore
Category:Stream
Programming Language:php
One-line Description:Recover the stream encapsulator that was previously logged out by the stream_wrapper_unregister() function

Function name: stream_wrapper_restore()

Function description: The stream_wrapper_restore() function is used to restore the stream encapsulator that was previously logged out by the stream_wrapper_unregister() function.

Usage: stream_wrapper_restore(void): bool

Parameters: None

Return value: Return true if the stream encapsulator is successfully restored; otherwise return false.

Example:

 <?php // 注销流封装器stream_wrapper_unregister('http'); // 恢复被注销的流封装器if (stream_wrapper_restore()) { echo '流封装器恢复成功'; } else { echo '流封装器恢复失败'; } ?>

Notes:

  • The stream_wrapper_restore() function needs to be called after the previously logged out stream wrapper, otherwise it will not be restored successfully.
  • If the restored stream encapsulator does not exist or cannot be restored, the function returns false.
  • This function is available in PHP 5.1.0 and above.
Similar Functions
Popular Articles