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?
filtering input from one stream into another
Moderator: General Moderators
-
patrickmvi
- Forum Commoner
- Posts: 32
- Joined: Mon Jun 22, 2009 6:45 am
- Location: Fort Lauderdale, FL
Re: filtering input from one stream into another
What is this second stream that you're talking about? I understand that you want to read in data from one stream and provide it to another but I'd like a better description on what you're trying to do so that I can better understand the issue.
Re: filtering input from one stream into another
Hi,
Thanks for your interest. I have actually solved the problem now by implementing a StreamWrapper class to wrap the incoming stream and do the processing on the way in before the data is read.
Thanks for your interest. I have actually solved the problem now by implementing a StreamWrapper class to wrap the incoming stream and do the processing on the way in before the data is read.