View Single Post
  #4  
Old 4th August 2007, 10:01
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,033
Thanks: 261
Thanked 147 Times in 128 Posts
Default

Quote:
Originally Posted by blu3ness
Hello, something I wrote very quickly. Could have bugs, havn't tested yet.
PHP Code:
#!usr/local/bin/php

<?php
$total 
0;

$fin = @fopen("path to file""r");
if (
$fin) {

    while (!
feof($fin)) {
        
$buffer fgets($fin);
        if (
preg_match('/<segment bytes="(\d+)"/',$buffer,$matched))
            
$total += $matched['1'];
        else
            continue;
        }
    
fclose($fin);
    print 
$total;

}
?>
Hi blu3ness,

This looks good! I'll give it a try later today.

Thank you
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote