View Single Post
  #3  
Old 4th August 2007, 09:38
blu3ness blu3ness is offline
Junior Member
 
Join Date: Aug 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Might be something like this

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;

}
?>
Reply With Quote