caching - php reading header into array from cached curl file -
this question has answer here:
- what type string? a:1:{s:2:“en”;} 3 answers
i using zebra_curl / curl cache webpages cache folder, , i'm wanting access looks header information holds original url , other information inside need when processing cached files.
at first thought json, , when using json_decode wasn't getting back, i've done bit of searching on internet, can find lots dumping cache file nothing reading cache file.
below sample, have stripped actual html webpage out purpose of post.
o:8:"stdclass":4:{s:4:"info";a:27:{s:12:"original_url";s:65:"http://www.amazon.co.uk/dp/b00oytaqam/ref=sr_1_1?m=a3p5rokl5a1ole";s:3:"url";s:65:"http://www.amazon.co.uk/dp/b00oytaqam/ref=sr_1_1?m=a3p5rokl5a1ole";s:12:"content_type";s:29:"text/html; charset=iso-8859-1";s:9:"http_code";i:200;s:11:"header_size";i:1021;s:12:"request_size";i:191;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:0;s:14:"redirect_count";i:0;s:10:"total_time";d:1.0510690000000000310365066980011761188507080078125;s:15:"namelookup_time";d:2.300000000000000001799775606325937360452371649444103240966796875e-5;s:12:"connect_time";d:0.036834999999999999686917107055705855600535869598388671875;s:16:"pretransfer_time";d:0.036865000000000001934008508897022693417966365814208984375;s:11:"size_upload";d:0;s:13:"size_download";d:111412;s:14:"speed_download";d:105998;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:0;s:18:"starttransfer_time";d:0.151627000000000011770140417866059578955173492431640625;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:13:"178.236.6.251";s:8:"certinfo";a:0:{}s:12:"primary_port";i:80;s:8:"local_ip";s:13:"192.168.0.102";s:10:"local_port";i:54085;}s:7:"headers";a:2:{s:12:"last_request";a:1:{i:0;a:5:{s:14:"request method";s:55:"get /dp/b00oytaqam/ref=sr_1_1?m=a3p5rokl5a1ole http/1.1";s:10:"user-agent";s:50:"mozilla/5.0 (compatible; msie 9.0; windows nt 6.2)";s:4:"host";s:16:"www.amazon.co.uk";s:6:"accept";s:3:"*/*";s:15:"accept-encoding";s:12:"gzip,deflate";}}s:9:"responses";a:1:{i:0;a:16:{s:6:"status";s:15:"http/1.1 200 ok";s:4:"date";s:29:"tue, 02 jun 2015 19:02:52 gmt";s:6:"server";s:6:"server";s:6:"pragma";s:8:"no-cache";s:10:"x-amz-id-1";s:20:"1bsmq0ww03gtyq9g5ky3";s:3:"p3p";s:180:"policyref="http://www.amazon.co.uk/w3c/p3p.xml",cp="cao dsp law cur adm ivao ivdo cono otpo our deli pubi otri bus phy onl uni pur fin com nav int dem cnt sta hea pre loc gov otc "";s:8:"x-sap-pg";s:30:"video_games_display_on_website";s:13:"cache-control";s:8:"no-cache";s:15:"x-frame-options";s:10:"sameorigin";s:7:"expires";s:2:"-1";s:10:"x-amz-id-2";s:64:"tlcbwlgclzuv2wrqsdudobecs3jz5e5mmdcirdxhnkstxmf1y3staao+fmghpfux";s:4:"vary";s:26:"accept-encoding,user-agent";s:16:"content-encoding";s:4:"gzip";s:12:"content-type";s:29:"text/html; charset=iso-8859-1";s:10:"set-cookie";s:99:"session-id=279-5866789-0523540; path=/; domain=.amazon.co.uk; expires=tue, 01-jan-2036 00:00:01 gmt";s:17:"transfer-encoding";s:7:"chunked";}}}s:4:"body";s:475134:" !!!html code here!! ";s:8:"response";a:2:{i:0;s:8:"curle_ok";i:1;i:0;}}
used unserialize() after @jon stirling recognised format
Comments
Post a Comment