hmm that explains allot. However the code you thought up doesn't seem to work. heres my updated code with your changes.
The error I'm getting is this.
Warning: array_map() [function.array-map]: Argument #2 should be an array in C:\Dans\web sites\snippets\test6.php on line 19
Warning: Invalid argument supplied for foreach() in C:\Dans\web sites\snippets\test6.php on line 21
1
Code:
<?php
$url = "http://fenopy.com/fakefinder/fake.php?cmd=tracker";
$text = @file_get_contents($url);
$str = $text;
//parse domains only (ex. domainname.com)
//preg_match_all('/http:\/\/(.*):(.*)<br\/>/', $text, $output); // fetch the content
//////////////////////////////////////
// Remove dupes
//////////////////////////////////////
//$unie = array_unique($output[1]);
//////////////////////////////////////
// change host to ip
//////////////////////////////////////
preg_match_all('!(http://.*?)<br/>!', $text, $output);
$urls = array_map('parse_url', $urls);
$hosts = array();
foreach($urls as $url)
{
$hosts[] = $url['host'];
}
$ips = array_unique(array_map('gethostbyaddr', $hosts));
//while (list($key, $value) = each($unie)) {
// $ip = gethostbyname(strtolower($value));
// $fin = array(1 => $ip);
//print_r($array);
// $endlist = array_unique($fin[1]);
echo "<pre>", print_r($ips[1]),"</pre>";
// echo '<li>' . $endlist . '</li>';
// }
?>
Also heres an update that I attempted on my own but still getting errors saying array_unique cannot be used becuse the argument is not an array.
<?php
$url = "http://fenopy.com/fakefinder/fake.php?cmd=tracker";
$text = @file_get_contents($url);
$str = $text;
preg_match_all('/http:\/\/(.*):(.*)<br\/>/', $text, $output); // fetch the content of the first <artist>-tag
//////////////////////////////////////
// change host to ip
//////////////////////////////////////
$unie = array_unique($output[1]);
foreach($unie as $key => $value){
$ip = gethostbyname(array_unique($value));
echo '<li>' . $ip . '</li>';
}
?>