2
header("Transfer-Encoding: chunked");
echo"32
12345678901234567890123456789012345678901234567890
0
"; flush();exit;

When requested with Firefox, 32 and 0 are missing. Why?

Gumbo
  • 620,600
  • 104
  • 758
  • 828
wamp
  • 5,513
  • 15
  • 51
  • 82

1 Answers1

8

The chunked transfer encoding is a sequence of chunks where each chunk consists of at least a size indicator and the chunk data.

In this case 32 and 0 are the size indicators in hexadecimal notation that denote the length of the following chunk data. A chunk size of 0 denotes the end of the chunked data stream.

Gumbo
  • 620,600
  • 104
  • 758
  • 828
  • +1 Here is a fairly decent explanation too: http://en.wikipedia.org/wiki/Chunked_transfer_encoding – Bruno Sep 30 '10 at 23:44