Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8980135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:00:16+00:00 2026-06-15T20:00:16+00:00

I am developing an application where there are different users related to different domains.

  • 0

I am developing an application where there are different users related to different domains.
In the admin panel i am adding a domain.
Now i need to display logo of each domain.
How can i dynamically display logo of any domain?
Is there any way that i input a domain name as a string and it returns domains information along with the image.
I know i can upload logos while adding a domain but i want it to do it with a simple helper function.
How can i achieve it.
Let suppose i need a function like this

$autoload['helper'] = array('domain_helper');

And to find domain

<img src = "<?php echo domain_image('https://www.google.com/'); ?>" >
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:00:17+00:00Added an answer on June 15, 2026 at 8:00 pm

    Use curl to pull the favicon from the website and save it as a png.

    http://php.net/manual/en/curl.examples-basic.php

    <?php
    $domain = "google.com";
    $image_name = "favicon.ico";
    
    touch("/var/www/domain_images/$domain.png");
    $fp = fopen("/var/www/domain_images/$domain.png", "w");
    
    $ch = curl_init("https://".$domain."/".$image_name);
    
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    
    curl_exec($ch);
    curl_close($ch);
    ?>
    

    EDIT

    A word of caution: if you are taking input from users to get the domain name, make sure you sanitize it before passing it along (as always)!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing the smart device application. There are different screen resolution for different
I am developing an application and part of the design is there is a
I have been developing the application for drawing, and there is the code: public
I have been developing the application for drawing, and there is the following code
I'm developing a Silverlight application where I want to simulate a console. There are
We've been developing an Android application which includes Google Adsense. However there seems to
I'm developing a ASP.NET MVC application. There is little space for me to put
I am developing a P2P streaming application. There are many library for playing multimedia
I am currently developing a little sketching application based on HTML5 Canvas element. There
I'm currently developing a cross-platform C application. Is there any compiler macro which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.