<?php
$domain = 'example.com';
$favicon_size = '48';
// using Google Favicon API
$api_url = 'https://www.google.com/s2/favicons?domain='.$domain.'&sz='.$favicon_size;
// retreiving the URL with PHP cURL
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $api_url);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
$file_content = curl_exec($curl_handle);
curl_close($curl_handle);
// saving the favicon localy
$target_file = './cache/favicons/'.$domain.'.png';
file_put_contents($target_file, $file_content);
// and/or sending to browser
header('Content-Type: image/png');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($target_file)).' GMT');
header('Content-Length: ' . filesize($target_file));
header('Cache-Control: public, max-age=2628000');
readfile($target_file);
exit;
<input id="range" type="range" min="0" max="10.0858" value="6.0868" step="0.0001" />
<input type="number" id="output" value="440" max="24000" min="1" step="1" />
<script>
'use strict';
let rangeElem = document.getElementById('range');
let outputElem = document.getElementById('output');
rangeElem.addEventListener('input', function() {
let value = rangeElem.value;
let adjusted = Math.exp(value);
outputElem.value = adjusted.toFixed(0);
});
outputElem.addEventListener('input', function() {
let value = outputElem.value;
let adjusted = Math.log(value);
rangeElem.value = adjusted;
});
</script>