Jump to content

Enclosing an IP range within a tag


ionicle

Recommended Posts

<?php

// Open the file
$fp = @fopen("koch.txt", 'r');

// Add each line to an array
if ($fp) {
$array = explode("\r\n", fread($fp, filesize("koch.txt")));
}

foreach ($array as $range){
echo "<deny>".$range."</deny>";
}

?>

It's not working. The two lines contain the following values:

 

x.x.x.x

x.x.x.x

 

When I run the script, all I get is:

 

"x.x.x.xx.x.x.x" ( the two values from the two lines glued together, with absolutely no "deny" tags )

 

What am I missing?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.