Jump to content

File_Get_Contents Or Iframe ? Less Memory Usage!


Manhag

Recommended Posts

In any case, memory size shouldn't be a concern at all in this case. If it is, then you either done something really inefficient, or you're fetching some really huge sites. Remember, images, CSS files, JS files and all other external references will not be fetched; Just the plain HTML of the URL in question.

 

If you're doing the latter, then you might need to open up a socket and fetch from the stream one line at a time. That, however, is only for very special cases.

 

Oh, as for what you should use: I'd go with cURL. Not only because it gives you more control, but also because some (most?) hosts disable retrieving files over the HTTP protocol with the file* family of functions.

 

Edit, added:

The big questions remains though: Why are you doing this, and what are you going to do with it?

Might be better ways to accomplish what you want, which we would know if provided with more detail of its application. ;)

Edited by Christian F.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.