PHP | stream_get_wrappers() Function
The stream_get_wrappers() function is an inbuilt function in PHP which is used to get the list of registered streams available on the running system.
Syntax:
array stream_get_wrappers( void )
Parameters: This function does not accept any parameter.
Return Value: The function returns an array containing the name of all available streams.
Below programs illustrate the stream_get_wrappers() function in PHP:
Program 1:
<?php // PHP program to illustrate // stream_get_wrappers function print_r(stream_get_wrappers()); ?> |
Array
(
[0] => https
[1] => ftps
[2] => compress.zlib
[3] => php
[4] => file
[5] => glob
[6] => data
[7] => http
[8] => ftp
[9] => phar
)
Program 2: Program to check the given streams are available or not.
<?php // PHP program to illustrate // stream_get_wrappers function $wrapper = array ( 'https', 'http', 'file', 'data', 'GFG'); // Checking stream wrapper enabled or not foreach ($wrapper as &$gfg) { if (in_array($gfg, stream_get_wrappers())) { echo $gfg . ': Enabled' . "\n"; } else { echo $gfg . ": Not Enabled" . "\n"; } } ?> |
https: Enabled http: Enabled file: Enabled data: Enabled GFG: Not Enabled
Reference: http://php.net/manual/en/function.stream-get-wrappers.php
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name from within that function using JavaScript ?
- D3.js | d3.map.set() Function
- D3.js | d3.hcl() Function
- D3.js | d3.lab() Function
- D3.js | d3.set.add() Function
- PHP | each() Function
- PHP | ord() Function
- p5.js | nfs() Function
- p5.js | box() Function
- CSS | hsl() Function
- PHP | cos( ) Function
- PHP | Ds\Map xor() Function
- PHP | tan( ) Function
- PHP | Ds\Map put() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



