On Thu, 29 Jul 2004 21:37:59 +0000 (UTC), Jonathan Lassoff
<[EMAIL PROTECTED]> wrote:
> There is a local radio station near me that has a crumby webserver that doesn't
> server HTTP requests in a standard way.
> So, I wrote a simple PHP script that fetches a playlist I want (with curl) and
> serves it properly. I only want to get a table from the resulting HTML file. I
> have it stored in a variable. So, my question is how would I go about removing
> the garbage I don't want until I hit the <table> tag I want and then remove
> everything after the </table> tag at the end?
> 

Assuming there's only one table in the document....

preg_match('!<table[^>]*>.*</table>!i', $text, $matches);
$table = $matches[0];

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to