0

I deal with a lot of development sites on my machine, and as such I'm building a landing page for my localhost root that will list out each site, which works great so far. I'd like to add a small thumbnail for each site's favicon, so how can I now search a site directory for the path to the favicon image? Each site has the following data in my script:

  • URL (localhost)

  • DocumentRoot

Most of the sites are in PHP, which poses an issue for things like get_file_contents() since the structure isn't always the same for where the 〈link〉 containing the favicon path is located.

Matt Dickey
  • 1
  • 1
  • 2
  • Does `$_SERVER['DOCUMENT_ROOT']` help you? Oh, and given mobile, Macs, etc, favicon is now [not quite as simple as it used to be](http://www.favicomatic.com/favicon-test). – Ken Y-N Jun 23 '17 at 00:59
  • No that doesn't quite get me anywhere. I already have the location of the document root, I need to find out where in the file system the icon lives. I know the 13 different sizes are ridiculous, once I can even get the parent path where the icons are, I should be able to parse a little more from there. – Matt Dickey Jun 23 '17 at 01:15
  • Is this a Javascript or PHP question? – Capsule Jun 23 '17 at 04:31
  • I'd be open to using PHP or JS to do this, which is why both are tagged. – Matt Dickey Jun 23 '17 at 05:53

0 Answers0