7
Upload favicon from external website
Grabbing a Favicon from external website
<?php
$url = 'http://example.com';
$favicon = "https://www.google.com/s2/favicons?domain=".$url;
if($favicon == false) {
$newimage = "0";
} else {
$extension = "png";
$time = date("ymdHis");
$newimage = $time.".".$extension;
$destination = "uploads/".$newimage;
if(@file_put_contents($destination,file_get_contents($favicon))) {
echo "true";
} else {
$newimage = "0";
}
}
?>
rated 7 times
(7)
(0)
comments: 0 / hits: 2149
/ 4 years ago, tue, feb 21, 17, 02:06:26
More From
» PHP
Comments
There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account