title: Get data only from html table used preg_match_all in php
body: <p>I have a html table like this :</p>
  
  <pre><code>&lt;table ... &gt;
  
    &lt;tbody ... &gt;
  
         &lt;tr ... &gt; 
               &lt;td ...&gt;
                    string...
                &lt;/td&gt;
                  &lt;td ...&gt;
                    string...
                &lt;/td&gt;
                  &lt;td ...&gt;
                    string...
                &lt;/td&gt;
                  &lt;td ...&gt;
                    string...
                &lt;/td&gt;
                  &lt;td ...&gt;
                    string...
                &lt;/td&gt;
         &lt;/tr&gt;
          &lt;tr ... &gt; 
               &lt;td ...&gt;
                    string...
                &lt;/td&gt;
                  &lt;td ...&gt;
                    string...
                &lt;/td&gt;
                  &lt;td ...&gt;
                    string...
                &lt;/td&gt;
                  &lt;td ...&gt;
               &lt;/td&gt;
                  &lt;td ...&gt;
                    string...
                &lt;/td&gt;
         &lt;/tr&gt;
         ..............
  
    &lt;/tbody&gt;
  
  
  &lt;/table&gt;
  </code></pre>
  
  <p>This is a data table and I need to get all data from this.
  The table will have many rows (<code>&lt;tr&gt;&lt;/tr&gt;</code>) . each row will have a fixed columns (<code>&lt;td&gt;&lt;/td&gt;</code>)(currently is 5 ).
  remember each table,tr,td tag maybe formatted (where say "...")</p>
  
  <p>And I hope everyone can help me to write a regex for <code>preg_match_all</code> function to get the data like this :</p>
  
  <pre><code>array(
     0 =&gt; array(
         0=&gt; 'some data0',
         1=&gt; 'some data1',
         2=&gt; 'some data2',
         3=&gt; 'some data3',
         4=&gt; 'some data4',
     )
     1 =&gt; array(
         0=&gt; 'some data0',
         1=&gt; 'some data1',
         2=&gt; 'some data2',
         3=&gt; 'some data3',
         4=&gt; 'some data4',
     )
     2 =&gt; array(
         0=&gt; 'some data0',
         1=&gt; 'some data1',
         2=&gt; 'some data2',
         3=&gt; 'some data3',
         4=&gt; 'some data4',
     )
  ..........
  )
  </code></pre>
  
  <p>Now the example for your test, hopfully you can help me!!!</p>
  
  <pre><code>&lt;table border="1" &gt;
    &lt;tbody style="" &gt;
  
         &lt;tr style="" &gt; 
               &lt;td style="color:blue;"&gt;
                    data0
                &lt;/td&gt;
                  &lt;td style="font-size:15px;"&gt;
                   data1
                &lt;/td&gt;
                  &lt;td style="font-size:15px;"&gt;
                    data2
                &lt;/td&gt;
                  &lt;td style="color:blue;"&gt;
                    data3
                &lt;/td&gt;
                  &lt;td style="color:blue;"&gt;
                    data4
                &lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr style="" &gt; 
               &lt;td style="color:blue;"&gt;
                    data00
                &lt;/td&gt;
                  &lt;td style="font-size:15px;"&gt;
                   data11
                &lt;/td&gt;
                  &lt;td style="font-size:15px;"&gt;
                    data22
                &lt;/td&gt;
                  &lt;td style="color:blue;"&gt;
                    data33
                &lt;/td&gt;
                  &lt;td style="color:blue;"&gt;
                    data44
                &lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr style="color:black" &gt; 
               &lt;td style="color:blue;"&gt;
                    data000
                &lt;/td&gt;
                  &lt;td style="font-size:15px;"&gt;
                   data111
                &lt;/td&gt;
                  &lt;td style="font-size:15px;"&gt;
                    data222
                &lt;/td&gt;
                  &lt;td style="color:blue;"&gt;
                    data333
                &lt;/td&gt;
                  &lt;td style="color:blue;"&gt;
                    data444
                &lt;/td&gt;
         &lt;/tr&gt;
  
    &lt;/tbody&gt;
  
  
  &lt;/table&gt;
  </code></pre>