Page 1 of 1

Parsing html

Posted: Sat Aug 09, 2008 2:02 am
by desmi
Ok, any ideas how to solve this:

Trying to parse HTML page by tags, the first one works great:

Code: Select all

$match = stristr($content, '<body>');
But then the problem..

Code: Select all

$match2 = stristr($content2, '</body>', true);
The server my files are running, is php 5.2.6, and that additional 'true' handler was added to 5.3.0..

Any ways to go around it? How to do it another way?

Re: Parsing html

Posted: Sat Aug 09, 2008 4:43 am
by filippo.toso
Why don't use regular expressions?

Re: Parsing html

Posted: Sat Aug 09, 2008 4:48 am
by desmi
Dont know how.. :/

Tried to learn it, but failed, cant find any good examples..