Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6864555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:55:35+00:00 2026-05-27T02:55:35+00:00

I’m trying to parse each IP line from the following file (loading from the

  • 0

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);

}

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:55:35+00:00Added an answer on May 27, 2026 at 2:55 am

    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);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
i want to parse a xhtml file and display in UITableView. what is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a reasonable size flat file database of text documents mostly saved in
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.