greenba Posted January 31, 2007 Share Posted January 31, 2007 Hi,I have the following HTML code:[code]<html>.....<-- start -->I need this text<-- end -->...</html>[/code]How can I read the entire page, and just take the piece "I need this text" ?thanx Quote Link to comment https://forums.phpfreaks.com/topic/36429-read-html-code/ Share on other sites More sharing options...
Jessica Posted January 31, 2007 Share Posted January 31, 2007 If it's a file, use file_get_contents() to get the entire contents as a string, then use strpos to find where <-- start --> and <-- end --> are, then use substr();You could also use regular expressions. Quote Link to comment https://forums.phpfreaks.com/topic/36429-read-html-code/#findComment-173351 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.