I have a string that could look like this
HTTP/1.1 200 OK
Server: Netscape-Enterprise/3.6 SP2
Date: Fri, 26 Jan 2001 14:55:36 GMT
Content-type: text/plain
Etag: "dd4e-3c99f8-39676d9c"
Last-modified: Sat, 08 Jul 2000 18:06:20 GMT
Content-length: 3971576
Accept-ranges: bytes
Connection: close
I want to extract some of the things like the Content-length and Content-type.
Now how do I do it the best way ?
The problem is that the fields are not allways on the same place so something like this does not work.
$pos = strpos ($output, 'Content-Length:');
$pos2 = strpos ($output, 'Accept-ranges');
Please help me out here 🙂