I am a beginner so bare with me please.
I am trying to create a PHP script to retrieve the location of an IP address using the info sniper.net webpage.
I am trying to parse the following HTML code:
and thought that the following PHP script would work:
It doesn't. what is wrong?
I am trying to create a PHP script to retrieve the location of an IP address using the info sniper.net webpage.
I am trying to parse the following HTML code:
Code:
map.openInfoWindow(map.getCenter(),"<br /><strong>n/a, Hong Kong</strong>");
Code:
<?php
$str = file_get_contents("http://www.infosniper.net/index.php?ip_address=203.84.219.114");
$regexp = "#<strong>([a-zA-Z])</strong>#i";
preg_match_all($regexp,$str,$out, PREG_PATTERN_ORDER);
echo $out;
?>
Comment