favicon on toplist

Started on the old forum in April 2012 · view the original in the archive · old links redirect here

#favicon #toplist

4 replies · 514 views · started 14 years ago · 1 min read

2 participants
billy1977 Developer · 94 posts #3

arnage wrote: Give this a try, just wrap matched in img tag.

$site = file_get_contents('http://somesite.tld');
if (preg_match('/\<link[^\>]+rel="(?:shortcut )?icon"[^\>]+?href="([^"]+?)"/i', $site, $matched)) {
	echo $matched[0];
} else {
	echo 'No favicons there';
}

You can refer to this for fine tuning if needed. 😉

http://coding-talk.com/f46/tag-content-retrieval-from-websites-with-preg_match-17152/

do i insert that on index page?

top counter stats @ http://top100.hostmob.in follow on twitter http://twitter.com/worldlistwap

arnage Lead · 811 posts #4

Where you want, just apply it to your needs.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close