PHP obtains the webpage file size instance code .? Php $ hostwww.ite5e.com; $ fpfsockopen ($ host, 80, $ errno, $ errstr, 30); if (! $ Fp) {echo $ errstr ($ errno) br;} else {$ outGETHTTP1.1; $ out. Host: $ host; $ ou
- $ Host = "www.ite5e.com ";
- $ Fp = fsockopen ("$ host", 80, $ errno, $ errstr, 30 );
- If (! $ Fp ){
- Echo "$ errstr ($ errno)
";
- } Else {
- $ Out = "GET/HTTP/1.1 ";
- $ Out. = "Host: $ host ";
- $ Out. = "Connection: Close ";
- }
- Fwrite ($ fp, $ out );
- $ I = 0;
- While ($ I <2)
- {
- $ I;
- $ Con. = fread ($ fp, 500 );
- }
- //
- Echo $ con;
- // Define the number of retrieved bytes
- Preg_match ("/Content-Length :.? (D)/", $ con, $ matches );
- $ Size = $ matches [1];
- Echo $ size;
- ?>
Http://www.bkjia.com/PHPjc/486166.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486166.htmlTechArticle? Php $ host = "www.ite5e.com"; $ fp = fsockopen ("$ host", 80, $ errno, $ errstr, 30); if (! $ Fp) {echo "$ errstr ($ errno) br/";} else {$ out = "GET/HTTP/1.1"; $ out. = "Host: $ host"; $ ou...