grab favicon from websites on failure use a local one [closed]
I want php code for grabbing favicons from different websites and resizing it and saving it in a directory. The code should first check if the favicon exists for a domain already and if it doesnt then it should grab it and save it and then display it, else display it straight away.
Thanking in advance.
Look into using curl or file_get_contents().
You will need to try and get the favicon using one of these methods, I suggest curl. Then determine if the response was a 404 not found, if it wasn't download the icon, store and resize.
Without more code or even an attempt at the solution it's hard to add anything else of worth.
精彩评论