I googled for this problem but there is no answer for it.
I want my PHP script to generate HTTP response in chunked( http://en.wikipedia.org/wiki/Chunked_transfer_encoding). How to do it?
Update: I figured it out. I have to specify Transfer-encoding header and flush it.
header("Transfer-encoding: chunked");
flush();
The flush is necessary. Otherwise, Content-Length header will be generated.
And, I have to make chunks by myself. With a helper function, it is not hard.
function dump_chunk($chunk)
{
echo sprintf("%x\r\n", strlen($chunk));
echo $chunk;
echo "\r\n";
}