I have a page at URL http://site.com/params. I want to read only the first n characters from this remote page. Functions like readfile(), file_get_contents() and curl seem to download whole of the pages. Can’t figure out how to do this in PHP.
Please help…!
file_get_contents()may be what you’re looking for if themaxlenparameter is utilized. By default, this function:However, the maxlen parameter is the maximum length of data read.
This implies that the entire file is not read, and only
maxlencharacters are read, ifmaxlenis defined.