| 
	
 | 
 Posted by soren625 on 12/12/06 17:07 
On Dec 12, 11:17 am, Geoff Berrow <blthe...@ckdog.co.uk> wrote: 
 
>Doesn't seem to work with this particular site unless I'm doing 
> something wrong 
 
I got it to work exactly as I needed: 
 
--------- START OF PHP CODE ---------------------- 
 
$file = file_get_contents("http://www.qrz.com/detail/KB2GSD"); 
$name_pattern = '/Name:(.*)/'; 
preg_match($name_pattern, $file, $match); 
echo strip_tags($match[1]).'<br />'; 
 
$city_pattern = '/Addr2:(.*),/'; 
preg_match($city_pattern, $file, $match); 
echo strip_tags($match[1]).'<br />'; 
 
$country_pattern = '/Country:(.*)/'; 
preg_match($country_pattern, $file, $match); 
echo strip_tags($match[1]).'<br />'; 
 
$state_pattern = '/State:(.*)/'; 
preg_match($state_pattern, $file, $match); 
echo strip_tags($match[1]).'<br />'; 
 
$grid_pattern = '/Grid:(.*)/'; 
preg_match($grid_pattern, $file, $match); 
echo strip_tags($match[1]).'<br />'; 
 
------------------ END OF PHP CODE ------------- 
 
Works like a charm! Thanks again!
 
  
Navigation:
[Reply to this message] 
 |