Yes, it saves memory and bandwidth ... I also checked the speed test (which doesnโt quite correspond to this question, but is useful and assumes it stops reading the stream) and the memory test just to demonstrate, I didnโt have a maximum memory test, but at least your $ html variable stores less information and stores memory there.
Time to get ALL characters of remote page 10 times: 6.0368211269379 Time to get ALL characters of remote page 10 times: 6.0158920288086 Time to get ALL characters of remote page 10 times: 5.8945140838623 Time to get ALL characters of remote page 10 times: 8.867082118988 Time to get ALL characters of remote page 10 times: 5.7686760425568 Time to get first ten characters of page 10 times: 4.2118229866028 Time to get first ten characters of page 10 times: 4.5816869735718 Time to get first ten characters of page 10 times: 4.2146580219269 Time to get first ten characters of page 10 times: 4.1949119567871 Time to get first ten characters of page 10 times: 4.1788749694824
Memory Useage First 10 characters:40048 Memory Useage ALL characters:101064
Ben d source share