preg_match...please help.

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
mcog_esteban
Forum Contributor
Posts: 127
Joined: Tue Dec 30, 2003 3:28 pm

preg_match...please help.

Post by mcog_esteban »

hi all.
i'm trying to read a url and parse the html, retriving only a few parts.
ex:
<html>
<body>
<b>Results<b><br>
<table>.....</table>
<b>Another results</b><br>
<table>....</table>
</body>
</html>

using preg_match, how can i print only the content in the tables after de <b> tags?

is there another way of doing this?
thanks.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

i dont understand, because in your example you showed things in bold but were not in the table tags... So what do you want? All the bold text, or just text thats int he table thats bold??
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

I'm not good enough at this but after the manual:
[php_man]preg_match[/php_man]

you could also look at this :
http://www.hotscripts.com/PHP/Scripts_a ... _Fetching/
Post Reply