how to separate data

Asked by thusitha

hi ,
i'm included MTR to the site and its working correctly. now i want is to get that data to a table.here is the example table.
Hostname %Loss Rcv Snt Last Best Avg Worst
 1. example.lan 0% 11 11 1 1 1 2
 2. ae-31-51.ebr1.Chicago1.Level3.n 19% 9 11 3 1 7 14
 3. ae-1.ebr2.Chicago1.Level3.net 0% 11 11 7 1 7 14
 4. ae-2.ebr2.Washington1.Level3.ne 19% 9 11 19 18 23 31
 5. ae-1.ebr1.Washington1.Level3.ne 28% 8 11 22 18 24 30
 6. ge-3-0-0-53.gar1.Washington1.Le 0% 11 11 18 18 20 36

and

this e code shows the result

 $output = shell_exec('mtr ' -r -c );
 echo "<pre>$output</pre>";
.so i need is get this as a table to show.how can i do that.
give some help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu mtr Edit question
Assignee:
No assignee Edit question
Solved by:
thusitha
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

You can use awk to get each section separated.

Revision history for this message
thusitha (thusitha555) said :
#2

$test=explode(" ",$output);
$test1=array();
array_push($test1,$test);

 hey by using this i separated that data pushed it to array. now its ok. now i can use this data as my own .
thanks