Snooble Posted September 26, 2009 Share Posted September 26, 2009 Hey, How would I copy the contents of an external html file and include it in a document on my server.. all via PHP. Just content, nothing dynamic. Is there a way with output buffering? Thank you! Snoobs Link to comment https://forums.phpfreaks.com/topic/175631-ob_start/ Share on other sites More sharing options...
sKunKbad Posted September 26, 2009 Share Posted September 26, 2009 What do you mean by "include it in a document"? Link to comment https://forums.phpfreaks.com/topic/175631-ob_start/#findComment-925451 Share on other sites More sharing options...
mattal999 Posted September 26, 2009 Share Posted September 26, 2009 Well, you could just use: $content = file_get_contents($url); // In PHP5 or above. Link to comment https://forums.phpfreaks.com/topic/175631-ob_start/#findComment-925452 Share on other sites More sharing options...
Snooble Posted September 26, 2009 Author Share Posted September 26, 2009 I'd like to grab the source of an external .html file and grab a specific part to include on my .php page. Thanks Link to comment https://forums.phpfreaks.com/topic/175631-ob_start/#findComment-925466 Share on other sites More sharing options...
Alex Posted September 26, 2009 Share Posted September 26, 2009 I'd like to grab the source of an external .html file and grab a specific part to include on my .php page. Thanks Sounds like you need what mattal999 suggested along with some regex to parse the file and get exactly the part you want out of it. Link to comment https://forums.phpfreaks.com/topic/175631-ob_start/#findComment-925484 Share on other sites More sharing options...
Snooble Posted September 26, 2009 Author Share Posted September 26, 2009 Sounds like you need what mattal999 suggested along with some regex to parse the file and get exactly the part you want out of it. Ok.. I have the contents of the website now.. using ob_start and an include.. what's regex? How can I extract a part of the site I want..? Thank you all. Snoobs Link to comment https://forums.phpfreaks.com/topic/175631-ob_start/#findComment-925501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.