sneakyninj4 Posted February 14, 2007 Share Posted February 14, 2007 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 More sharing options...
fert Posted February 14, 2007 Share Posted February 14, 2007 http://us2.php.net/manual/en/function.explode.php http://us2.php.net/manual/en/function.substr.php Link to comment https://forums.phpfreaks.com/topic/38404-pulling-html-from-an-external-site/#findComment-184180 Share on other sites More sharing options...
benjaminbeazy Posted February 14, 2007 Share Posted February 14, 2007 do you know the exact lines or do they vary dynamically? Link to comment https://forums.phpfreaks.com/topic/38404-pulling-html-from-an-external-site/#findComment-184182 Share on other sites More sharing options...
sneakyninj4 Posted February 14, 2007 Author Share Posted February 14, 2007 do you know the exact lines or do they vary dynamically? The lines do not change at all. (currently reading about explode) Link to comment https://forums.phpfreaks.com/topic/38404-pulling-html-from-an-external-site/#findComment-184186 Share on other sites More sharing options...
hitman6003 Posted February 14, 2007 Share Posted February 14, 2007 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)); Link to comment https://forums.phpfreaks.com/topic/38404-pulling-html-from-an-external-site/#findComment-184188 Share on other sites More sharing options...
sneakyninj4 Posted February 14, 2007 Author Share Posted February 14, 2007 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! =) Link to comment https://forums.phpfreaks.com/topic/38404-pulling-html-from-an-external-site/#findComment-184206 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.