<?php $time = $_GET[option]; //$time = "20131007"; exec("/bin/cat /mnt/tclog/total_{$time}", $traffic); $go = new box(); foreach ($traffic as $value) { if ($value) { $input = explode(",", $value); $time = explode("-:", $input[0]); for ($i = 1; $i < count($input); $i++) { $name = explode("-", $input[$i]); $low = $go->input($time[1], $name[1]); $boxbig[$name[0]][0] .= $low . ","; } } } foreach ($boxbig as $key => $value) { if ($key != '' && $value != '') { $data .= $key . "-:" . $value[0] . ":"; } } //echo print_r($boxbig); echo $go->debug($data); class box { function input($box, $str) { //$tmp_box=$box.",".$str; $tmp_box = $str; return $tmp_box;
exec("/bin/cat /mnt/tclog/total_{$data_1}", $traffic); $go = new box(); foreach ($traffic as $value) { if ($value) { $input = explode(",", $value); $time = explode("-:", $input[0]); for ($i = 1; $i < count($input); $i++) { $name = explode("-", $input[$i]); if ($name[0] != '') { $total[$name[0]] += $name[1]; } } } } foreach ($total as $key => $dd) { $low = $go->input($date_format, $dd); $boxbig[$key][0] .= $low . ","; } } //echo $go->debug($boxbig); foreach ($boxbig as $key => $value) { $data_2 .= $key . "-:" . $value[0] . ":"; } //echo print_r($boxbig); echo $go->debug($data_2); class box { function input($box, $str) { //$tmp_box=$box.",".$str; $tmp_box = $str;