Gruzin Posted February 27, 2007 Share Posted February 27, 2007 Hi guys, I have a HTML file with some data in it, say rental info. I need to "cut out" (pull out) the info from one topic (Rent) to another. Is that possible with php? P.S I have attached sample HTML file. Any help will be greatly appreciated, George [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/40334-cut-out-info-from-html-source/ Share on other sites More sharing options...
monk.e.boy Posted February 27, 2007 Share Posted February 27, 2007 Get the HTML: http://uk.php.net/manual/en/ref.curl.php Dig bits out of it: http://uk.php.net/manual/en/ref.regex.php monk.e.boy Link to comment https://forums.phpfreaks.com/topic/40334-cut-out-info-from-html-source/#findComment-195151 Share on other sites More sharing options...
Gruzin Posted February 27, 2007 Author Share Posted February 27, 2007 Thanks a lot, Actually I want to pull out some info from string begining with A and ending with B... Regards, George Link to comment https://forums.phpfreaks.com/topic/40334-cut-out-info-from-html-source/#findComment-195154 Share on other sites More sharing options...
monk.e.boy Posted February 27, 2007 Share Posted February 27, 2007 if (preg_match('/a[^b]*?b/', $subject)) { } else { } try that. This is lazy matching (google regex lazy match) so it'll match twice in the following: acccccbacccccb BTW http://www.phpfreaks.com/forums/index.php/board,43.0.html monk.e.boy Link to comment https://forums.phpfreaks.com/topic/40334-cut-out-info-from-html-source/#findComment-195168 Share on other sites More sharing options...
Gruzin Posted February 27, 2007 Author Share Posted February 27, 2007 if (preg_match('/a[^b]*?b/', $subject)) { } else { } try that. This is lazy matching (google regex lazy match) so it'll match twice in the following: acccccbacccccb BTW http://www.phpfreaks.com/forums/index.php/board,43.0.html monk.e.boy Thanks monk.e.boy, I'm gonna look at it Link to comment https://forums.phpfreaks.com/topic/40334-cut-out-info-from-html-source/#findComment-195174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.