All I want to do is add a favicon.ico to my PHP website. Is there a simple PHP way of doing this or can it only be done with an HTML reference page?
Maybe using some jQuery/Ajax/JavaScript?
By default, most browsers will try to resolve the favicon.ico, even if you do not mention it in the HTML of the website (just make sure the file is in the root of the website directory). However, for compatibility, you should add the html code for it in the section of your web page.
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With