按file_get_contents限制字符串加载


Limit string loading by the file_get_contents

有没有办法限制使用file_get_contents('http://myurl.com/');加载的字符数量?

我只需要从 URL 加载前 500 个字符以节省加载时间 - 这可能吗?我听说过这样的方法,但不知道它是否可行。

file_get_contents有一个maxLen参数来做到这一点。