filtering input from one stream into another
Posted: Sun Jun 21, 2009 7:31 am
What would be the best way to accomplish this in PHP?
I need to read data coming in via php://input, check the data for a particular marker and write the data out to another stream up to the marker.
This sounds easy and I've got it working great when outputting to a file but I need to output to another HTTP stream using CURL. I was thinking that maybe there is a way to open a memory stream and duplicate the handle, letting the input code keep writing to it while CURL is reading from it but I can't figure what would be the best way to go about it.
Is there a way to do something like this in PHP?
I need to read data coming in via php://input, check the data for a particular marker and write the data out to another stream up to the marker.
This sounds easy and I've got it working great when outputting to a file but I need to output to another HTTP stream using CURL. I was thinking that maybe there is a way to open a memory stream and duplicate the handle, letting the input code keep writing to it while CURL is reading from it but I can't figure what would be the best way to go about it.
Is there a way to do something like this in PHP?