News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate's Blog:
Creating custom stream filters
June 17, 2009 @ 07:56:28

In a new post to his blog Sameer takes a look at streams and filters in PHP applications, specifically how to set up a custom filter to attach to any stream.

In this post we will see how to create a custom stream filter. Streams, first introduced in PHP 4.3, provide an abstration layer for file access. A number of different resources besides files - like network connections, compression protocols etc. can be regarded as "streams" of data which can be serially read and written to.

Streams are the method "behind the scenes" for several of the PHP functions you already use (like fsockopen and file_get_contents). His example shows you how you can manually create a stream and attach a filter to it to replace URLs in the contents of the stream with the "[---URL---]" string and push it back to the standard output.

0 comments voice your opinion now!
filter custom tutorial stream


blog comments powered by Disqus

Similar Posts

Nadeau Software: PHP tip: How to get a web page using CURL

Zend Developer Zone: Uploading YouTube Videos with Zend Framework

Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHPUnit part 3

Stefan Mischook's Blog: Creating Your Own Functions - Part 2

PHPBuilder.com: Securing Data Sent Via GET Requests


Community Events





Don't see your event here?
Let us know!


laravel release introduction list opinion community symfony tool version conference configure podcast interview composer api framework voicesoftheelephpant series unittest language

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework