PHP Parse文件,替换不是必需的项目出错

I'm trying to parse each IP line from the following file (loading from the web) and I'm going to store the values in database so i'm looking to put them in to an array.

The file its loading has the following source:

12174 in store for taking<hr>221.223.89.99:8909

<br>123.116.123.71:8909

<br>221.10.162.40:8909

<br>222.135.5.38:8909

<br>120.87.121.122:8909

<br>118.77.254.242:8909

<br>218.6.19.14:8909

<br>113.64.124.85:8909

<br>123.118.243.239:8909

<br>124.205.154.181:8909

<br>124.117.13.116:8909

<br>183.7.223.212:8909

<br>112.239.205.245:8909

<br>118.116.235.156:8909

<br>27.16.28.174:8909

<br>222.221.142.59:8909

<br>114.86.40.251:8909

<br>111.225.105.142:8909

<br>115.56.86.62:8909

<br>59.51.108.142:8909

<br>222.219.39.194:8909

<br>114.244.252.246:8909

<br>202.194.148.41:8909

<br>113.94.174.239:8909

<br><hr>total£º 24¡£

So I guess I'm looking to take everything between the <hr>'s and add each line line by line.

However doing the following doesn't seem to be working (in terms of stripping it the parts i dont' want)

<?php
$fileurl = "**MASKED**";

$lines = file($fileurl);

foreach ($lines as $line_num => $line) {

    $line2 = strstr($line, 'taking', 'true');
    $line3 = str_replace($line2, '', $line);
    print_r($line3);

}

?>

If you want to add the values to an array, why not doing that directly inside the loop? I'd do something like this:

$output = array();
foreach ($lines as $line) {
    if(preg_match("/<br>\d/", $line)) {
        $output[] = substr($line, 4);
    }
}
print_r($output);

Look into PHP function explode: http://www.php.net/manual/en/function.explode.php

It can take a string, and create an array out of it, by splitting at a specific character. In your case, this might be <br>

Also, trim function can get rid of the whitespace when needed.