amm please kindly check this code? cos it won’t work..
<?php
$page = file_get_contents("http://natadec0c0.tumblr.com/");
$avatar = preg_match('/<a rel="shortcut icon" href="(http+)"/', $page, $matches) ? $matches[1]: 'http://27.media.tumblr.com/avatar_749f6bc22627_128.png';
echo $avatar;
?>
To Grab copy this tag view-source:http://natadec0c0.tumblr.com/
<link rel="shortcut icon" href="http://25.media.tumblr.com/avatar_fa85d9b5e571_16.png" />
whew almost half of hour im stuck in this problem.. hope someone can help me…
You’re searching for an
<a rel..., instead of a<link rel....Also, you’ll likely want something like
(http.+?)instead of(http+).A better better way for finding that link though would be something like:
In the above example, you’d first be looking for
<link/>tags, then look for thehrefattribute in the found link tags. Just in case they look a little differently from what you expect them to look like.