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

  • Home
  • SEARCH
  • 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 7022229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:33:17+00:00 2026-05-27T23:33:17+00:00

I am using server side for getting photos from external url. I am using

  • 0

I am using server side for getting photos from external url. I am using simple php dom library for getting this as per SO suggestion. But I am lacking performance in this. I mean for some sites I am not able to get all the photos.
$url has the example external site which is not giving me all the images.

  $url
  ="http://www.target.com/c/baby-baby-bath-bath-safety
  /-/N-5xtji#?lnk=nav_t_spc_3_inc_1_1";
  $html = file_get_contents($url);
  $doc = new DOMDocument();
  @$doc->loadHTML($html);
  $tags = $doc->getElementsByTagName('img');

  foreach ($tags as $tag) {
      echo $imageUrl = $tag->getAttribute('src');
   echo "<br />";
  }

Is this possible I can have functionality/accuracy similar to the option of Firefox

Firefox-> tools -> page info -> media

I mean I just want to be more accurate for this as the existing library is not fetching all images. Also I tried file_get_content…which is also not fetching all the images.

  • 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-05-27T23:33:17+00:00Added an answer on May 27, 2026 at 11:33 pm

    You need to use regular expressions to get images’ src. DOMDocument build all DOM structure in memory, You needn’t it. When You get URLs, use file_get_contents() and write data to files. Also add max_execution_time if You’ll parse many pages.

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

Sidebar

Related Questions

I am just getting started creating an AJAX application using server side push. I
For example, writting server-side things using javascript, instend of php.
i am using following webservices for retrieving data from server server side:.net client side:ksoap2
I am getting response from server side in the form of json array.I need
Trying to get a list of drives from a server side application using a
I am doing form submission and validation using jQuery and from server side I
Possible Duplicate: What is the safest way of passing arguments from server-side PHP to
How to construct a GQL query using server side admin datastore viewer, a one
I would like to know how threads are handled on the server side using
I am using GDI+ on the server-side to create an image which is streamed

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.