There are various inbuilt wrapper for a different type of URL- style protocols in PHP. These wrappers are used in many other file system functions. Registration of custom wrapper is also allowed in PHP. It can be done so through stream_wrapper_register() function.
In PHP the URL syntax supported is scheme://
The URL syntax not supported in PHP are:
There are 12 wrapper in PHP.
|file://||Local file system is accessed through it||This default wrapper in PHP is representing local file system.|
|http://||HTTP(s) URLs is accessed through it||The mentioned relative path is applied against present working directory.|
|ftp://||FTP(s) URLs is accessed through it||New files are created and earlier ones are accessed through FTP. If passive mode FTP is not supported by the server then there is a fail in connection.|
|php://||Multiple type of I/O streams is accessed through it||I/O error file descriptors, streams, inmemory can be read and written through other I/O streams.|
|zlib://||Streams are compressed||Works in a similar manner as gzopen(), except the fact that other file system functions can be used with it.|
|data://||Data (RFC 2397)||Reading contents or media type which can be later printed.|
|glob://||Finding pathnames such that it matches the pattern||The most common use includes searching over the directory and printing a file’s name and size.|
|phar://||Archive in PHP||Read and write can be performed individually as well as simultaneously but cannot be appended.|
|ssh2://||Shell 2 is secured||This wrapper is not available by default in PHP, for accessing it SSH2 extension needs to be downloaded.|
|rar://||RAR||The URL path(encoded) is taken to RAR archive where RAR can be relative or absolute. Other optional things that are stored in archive are – asterik(*), number sign(#) and entry name. Both directories and files are accessable through it.|
|ogg://||Audio stream||The ogg:// wrapper opens the file that are compressed audio that have been encoded through OGG/Vorbis codec. Even if the files are appended they are compressed audio. This wrapper is not available by default in PHP, for accessing it OGG/Vorbis extension needs to be downloaded.|
|expect://||Interaction streams are processed||This wrapper makes stderr, process’es stdio and stdout accessable. This wrapper is not available by default in PHP, for accessing it Expect extension needs to be downloaded.|
- Create a GeeksforGeeks Wrapper Application using Electron
- How to align header with wrapper in Bootstrap ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- Difference and Similarities between PHP and C
- How to select and upload multiple files with HTML and PHP, using HTTP POST?
- LAMP installation and important PHP configurations on Ubuntu
- PHP | echo and print
- PHP | (Include and Require)
- HTTP GET and POST Methods in PHP
- PHP | Date and Time
- PHP | strpos() and stripos() Functions
- PHP | strrpos() and strripos() Functions
- PHP | Imploding and Exploding
- PHP | include_once() and require_once()
- PHP | Separate odd and even elements from array without using loop
- PHP | Sort array of strings in natural and standard orders
- PHP program to find the maximum and the minimum in array
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.