Jump to content

pulling html from an external site


sneakyninj4

Recommended Posts

Hello all!

  I'm really new to php and I'm still learning it's capabilities. I'm not sure if php can do what I need but it might. (I am probably going about it the wrong way).  What i'm trying to do is display part of a webpage on another page. I am pretty sure I can use fpassthru() or include() to do this, however, it always prints the entire page.

 

Is there a way to have the code only a print out ~30 lines of code from an external website?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/38404-pulling-html-from-an-external-site/
Share on other sites

Use file to read the site into an array...it will determine each element by the newline characters (\n or \r or \n\r).  Then just echo out a part of the array...

 

echo implode("", array_slice($remote_site, $offset, 30));

 

Thank you very much! =)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.