Posted By

Tank on 03/29/08


Tagged

log lighttpd parsing


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Tank
iTony


Get Method (GET/POST) from Lighttpd Log


 / Published in: PHP
 

  1. private function getMethod($buffer)
  2. {
  3. $methodStart = strpos($buffer, "\"") + 1;
  4. $methodEnd = strpos($buffer, "\"", $methodStart);
  5.  
  6. $requestString =
  7. substr($buffer,
  8. $methodStart,
  9. $methodEnd - $methodStart
  10. );
  11.  
  12. list($method, $page, $protocol) =
  13. split(" ", $requestString);
  14.  
  15. return $method;
  16. }

Report this snippet  

You need to login to post a comment.