extract/parsing href website

<?php
$data = @file_get_contents("http://www.ip-adress.com/ip_tracer/202.43.188.27") or die("tidak bisa access: ".$data);
$pattern = "/href=(\"??)([^\" >]*?)\\1[^>]*/siU";
preg_match_all($pattern, $data, $links);
foreach($links as $lks){
 foreach($lks as $l){
 echo $l . "<br />";
 }
}
?>

hasil yg didapat

$l[0][n] = href=”/favicon.ico”

$l[1][n] =”

$l[2][n] = /favicon.ico

 

 

Published by

G3n1k

just to remember what i had known :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s