Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
What different between using echo and php output stream ?
What different between php://stdout and php://output
Why use php stream and which method will be better for output ?
Let's see using fopen adds alot of extra unneeded overhead, slower and just the worst way ever to send output to a browser.
It's like driving 5 miles out of your way to get from point A to point B when you could have diven 100 feet in a straight line to get from point A to point B.
quocbao wrote:Why use php stream and which method will be better for output ?
If you are outputting to the HTTP Response (or stdout in command line) then echo() is the simplest way to output text. Read/writing to files, sockets, etc. is when you need to use other functions.