I/O Streams
Posted: Fri Dec 30, 2011 7:48 am
I recently heard about I/O Streams, and got curious of how to use it.
I found out PHP had built in (files?) for that. php://stdin, php://stdout, etc,
But though I've googled around and read some articles and stuff,
I still don't get WHAT it (I/O Streams, stdin and stdout) is?
I get that it is standard input and output,
and stdin is read-only, and stdout is writeonly and so on,
but where does it come from - the standard input?
If your write this
What would stdin contain? Why is it considered a file?
And where would the stuff you write to php://stdout go?
can you access php:// in browsers just like http://, ftp://, https://, etc?
I sincerely hope to get these questions answered.
Thanks in advance.
I found out PHP had built in (files?) for that. php://stdin, php://stdout, etc,
But though I've googled around and read some articles and stuff,
I still don't get WHAT it (I/O Streams, stdin and stdout) is?
I get that it is standard input and output,
and stdin is read-only, and stdout is writeonly and so on,
but where does it come from - the standard input?
If your write this
Code: Select all
fopen("php://stdin",r+)And where would the stuff you write to php://stdout go?
can you access php:// in browsers just like http://, ftp://, https://, etc?
I sincerely hope to get these questions answered.
Thanks in advance.