0

I have a table. How to put only table ip:port?

<table>
<tr><th colspan="3">Total Socks In List : 78</th><th style="border:none;background:none"></th></tr>
<tr><th>IP Address : Port</th><th>Country</th><th>Last Updated</th></tr>
<tr><td>166.78.xxx.xx:36xx</td><td><img src="../images/flag/UNITED STATES.png" width="18" height="12" alt="UNITED STATES.png"/>
UNITED STATES</td><td>18/06/2014 02:06:58</td></tr>
<tr><td>68.40.xxx.xxx:23xx</td><td><img src="../images/flag/UNITED STATES.png" width="18" height="12" alt="UNITED STATES.png"/>UNITED STATES</td><td>18/06/2011 02:06:07</td></tr>
<tr><td>76.184.xxx.xxx:72xx</td><td><img src="../images/flag/UNITED STATES.png" width="18" height="12" alt="UNITED STATES.png"/>UNITED STATES</td><td>18/06/2011 02:06:13</td></tr>
</table>

Here is my code php:

<?php 
function njipuk($awal,$keri,$­tulisane)
{ 
    $kata = explode($awal,$tulis­ane); 
    $kata = explode($keri,$kata[­1]); 
    return $kata[0]; 
} 
$page = file_get_contents("mysite/"); 
echo njipuk('</td></tr><tr><td>','</td>',$page); 
?>
Peter Bowers
  • 3,063
  • 1
  • 10
  • 18
  • this my code php ','',$page); ?> – Andy Triyanto Apr 19 '15 at 05:47
  • When I edited your question I added a semi-colon after your `file_get_contents(...)` - if that wasn't just a typo transferring it to the comment, you'll need to add that. In the future, add your code directly to your question by editing your question. – Peter Bowers Apr 19 '15 at 05:57
  • So is your `...
    ` what you are reading in from "mysite/"? Or are you reading in some other data and generating that table?
    – Peter Bowers Apr 19 '15 at 05:58
  • I think what you are looking for is a DOM Parser. Processing HTML with regex, while possible in limited cases, is not usually practical nor recommended. See http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags for some entertaining answers related to this. – Peter Bowers Apr 19 '15 at 06:03
  • this reading from this site http://www.socks5proxies.com/index.php?action=freesocks&country=UNITED+STATES, – Andy Triyanto Apr 19 '15 at 06:20

0 Answers0