stream_get_wrappers
Get the registered stream type
Function name: stream_get_wrappers()
Applicable version: PHP 4 >= 4.3.0, PHP 5, PHP 7
Usage: The stream_get_wrappers() function returns an array of registered stream protocol wrappers.
Example:
// 检索已注册的流协议包装器$wrappers = stream_get_wrappers(); // 打印已注册的流协议包装器print_r($wrappers);
Output example:
Array ( [0] => php [1] => file [2] => http [3] => ftp [4] => compress.zlib [5] => compress.bzip2 [6] => phar [7] => zip [8] => data [9] => glob [10] => ssh2.shell [11] => ssh2.exec [12] => ssh2.tunnel [13] => ssh2.scp [14] => ssh2.sftp [15] => ssh2.sftp:// [16] => ssh2.scp:// [17] => ssh2.shell:// [18] => ssh2.exec:// [19] => ssh2.tunnel:// )
In the above example, we use the stream_get_wrappers() function to get the registered stream protocol wrapper and print the result using the print_r() function. The output example shows some common wrappers, such as php, file, http, ftp, etc.