Re: getting what's between <td></td>

From: Date: Thu, 22 Feb 2001 05:42:46 +0000
Subject: Re: getting what's between <td></td>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41101@lists.php.net to get a copy of this message
Maybe something along the lines of: $results = eregi("<tr><td>Item3</tr><td>[a-Z 0-9]</td></tr>", $data); -David On Wed, 21 Feb 2001 23:32:04 -0600, Tyler Longren said: > Hello, > > I've been reading a LOT on how to solve my problem today, but haven't been > able to come up with anything yet. > > Here's my problem: > I have an html file that contains many table rows like this: > > <tr><td>Item1</td><td>Item1 Again</td></tr> > <tr><td>Item2</td><td>Item2 Again</td></tr> > <tr><td>Item3</tr><td>Item3 Again</td></tr> > <tr><td>Item4</tr><td>Item4 Again</td></tr> > > And so on. I want to search this html for a table row that has 'Item3' in > the first cell. And the second cell should contain 'Item3 Again'. I know > that I can do this with something like this: > > $file = fopen("http://localhost/html.html", > "r"); > $data = fread($file, 10000); > $results = eregi("<tr><td>Item3</tr><td>Item3 > Again</td></tr>", $data); > > > However, this won't exactly work for me, because that contents of the > second cell will change daily, so tomorrow, the third table row could look > like this: > > <tr><td>Item3</td><td>Item3 Has Changed</td></tr> > > I was thinking I could use sscanf() to do this, but couldn't get anything > to work. I've tried everything I can think of. > > Sorry if the explanation of my problem was hard to understand, I don't > exactly understand it myself. Thanks everybody!!! > > Regards, > Tyler Longren > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- TANSTAAFL

« previous php.general (#41101) next »