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! Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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) Quote Link to comment 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)); Quote Link to comment 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! =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.