PHP: filter php: // filter is an encapsulation protocol designed to allow a filter program to flow when it is opened. This is useful for file functions with complete functions such as readfile (), file (), and file_get_contents (). Otherwise, you will not be able to apply the filter to the stream before reading the content.
The protocol syntax is
Php: // filter:/=
For example php: // filter:/resource = http://www.baidu.com
Use php: // filter to obtain webpage content
Php: // filter parameter list
Read
Write
Resource Data Source (required)
The read parameter value can be
String. strip_tags clears all html tags in the data stream
String. toupper converts the content in the data stream to uppercase
String. tolower converts the content in the data stream to lowercase
Convert. base64-encode converts contents in the data stream to base64 encoding
Convert. base64-decode corresponds to the above decoding
Example:
Using string. strip_tags to process data is comparable to the strip_tags function, because the data has been synchronized ..
The usage of other parameters is the same.
There are also many such filter encapsulation protocols. for details, refer to the official php website.
Http://docs.php.net/manual/zh/wrappers.php
You can also create a stream package.
How to use the stream_wapper_register function to go to the official website.