Parsing html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
desmi
Forum Commoner
Posts: 64
Joined: Sun Jun 15, 2008 4:55 am

Parsing html

Post 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?
filippo.toso
Forum Commoner
Posts: 30
Joined: Thu Aug 07, 2008 7:18 am
Location: Italy
Contact:

Re: Parsing html

Post by filippo.toso »

Why don't use regular expressions?
desmi
Forum Commoner
Posts: 64
Joined: Sun Jun 15, 2008 4:55 am

Re: Parsing html

Post by desmi »

Dont know how.. :/

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