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 Quote 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"? Quote 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. Quote 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 Quote 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. Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/175631-ob_start/#findComment-925501 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.