static function getTimeFromString($string) { $line = preg_replace('/\\s+/', " ", $string); list($ip, $h, $f, $tdate, $timestamp, $modethid, $url, $code, $size) = explode(" ", $line); $edate = str_replace("[", "", $tdate); list($date, $month, $year1) = explode("/", $edate, 3); list($year, $hour, $min, $second) = explode(":", $year1, 4); $s = mktime($hour, $min, $second, monthToInt($month), $date, $year); //dprint("Date" . date("d-M-Y-H-i-s", $s). " " . $tdate. "\n"); return $s; }
function testFunc() { $inittime = time(); $hour = 0; $min = 0; $second = 0; $month = 'Jun'; $date = 21; $year = 2005; $s1 = mktime($hour, $min, $second, monthToInt($month), $date, $year); $date = 22; $s2 = mktime($hour, $min, $second, monthToInt($month), $date, $year); $res = getEachwebfilequota("/home/root/paid-my-traffic.com-custom_log", $s1, $s2); $total = time() - $inittime; dprint("Total Time {$total} seconds \n"); }