title: Format exec() system() output
body: <p>I need to the get the output of a command on unix on a webpage, in a tabular format.
  This is what I used to do :
  This basically generates a html code, which i redirect to a html page and access it from a webpage.</p>
  
  <pre><code>echo "&lt;html lang=en xml:lang=en xmlns=http://www.w3.org/1999/xhtml&gt;"
  echo "&lt;head&gt;"
  echo "&lt;title&gt; Team Page &lt;/title&gt;"
  echo "&lt;/head&gt;"
  echo "&lt;body bgcolor=#ddfedg font-family=Comic Sans MS&gt;"
  echo "&lt;table border=1&gt;"
  cat $i|grep %|grep -v on|awk '{printf "&lt;tr&gt;&lt;td&gt;%-10s&lt;/td&gt; &lt;td&gt;%-10s&lt;/td&gt; 
  &lt;/tr&gt;\n",$NF,$(NF-1)}'
  echo "&lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;"
  </code></pre>
  
  <p>Previously , I used to set it as a cronjob on unix and generate a html page for every 15 minutes.</p>
  
  <p>Now, I want to make this access realtime..like fresh data is loaded each time the page is loaded.
  I tried using the exec() and system() functions in php ,but I am not able to figure out how to tabulate the output. </p>
  
  <p>The output shows up as :</p>
  
  <pre><code>Array ( 
    [0] =&gt; / 5% 
    [1] =&gt; /stand 10% 
    [2] =&gt; /var 36%
    [3] =&gt; /usr 40%
    [4] =&gt; /ts_undo 31%
    [5] =&gt; /ts_temp 96%
    [6] =&gt; /ts_redo3 13%
    [7] =&gt; /ts_redo2 13%
    [8] =&gt; /ts_redo1 13%
    [9] =&gt; /ts_index 7%
    [10] =&gt; /ts_data 96%
    [11] =&gt; /tmp 54%
    [12] =&gt; /test_db 65% 
    [13] =&gt; /oracle 22%
    [14] =&gt; /oraarch 36%
    [15] =&gt; /opt 20%
    [16] =&gt; /home 38%
    [17] =&gt; /Oracle10g 76%
  ) 
  </code></pre>
  
  <p>Please help me out on this issue.</p>