Web Analytics Made Easy -
StatCounter Need help with a script - CodingForum

Announcement

Collapse
No announcement yet.

Need help with a script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with a script

    Hello, I am a beginner in PHP.

    I would like help in extracting IP addresses from a html text page.

    http://www.anticheatinc.com/tex/MBLs/pbbans.txt

    eg there are hundreds of IP addresses, but I only want to extract ones that are displayed more than once and display them on a separate output file.

    Can anyone help me out.

    Thanks.

  • #2
    The way I'd do it is load the file into an array with the file() function.

    Then, loop through the array. Use a regular expression on each array element to isolate the IP address in the line and dump that into another array to create an array of IP addresses.

    Then, I'd use the array_unique() function on your IP array.

    Comment

    Working...
    X