Link to home
Start Free TrialLog in
Avatar of lopband
lopband

asked on

PHP Regex to get link and size...

Hello!

I need to open a html page and read the file, then i need to extract two things from _many_ blocks that look like this:

<tr class="text">
<td><a href="http://media4.something.com/DPliana/something/midband/DPliana_4.mp4">Download</a></td>
<td align="left"><span class="text">something here</span></td>
<td align="center">82 MB</td>
</tr>


I *only* want the links that have the text "Download", note that there are plenty of other links on the page both with the text 'Download' and without. Lastly i need the filesize which will always be in the same _place_ as above.

So the above  should give me an array:
someArray ( [link1] => "http://media4.something.com/DPliana/something/midband/DPliana_4.mp4"  [size1] =>  "82 MB")
ASKER CERTIFIED SOLUTION
Avatar of jumanj1
jumanj1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lopband
lopband

ASKER

That does work pretty well, but i was looking for a regex solution...

if nobody else posts i'll give you the points.

Thanks!
Avatar of lopband

ASKER

ok, it seems to be working exactly as planned so i'll give you the pts.. cheers!
Avatar of lopband

ASKER

thanks!