PDA

View Full Version : What function pulls substrings from a string


kobescoresagain
02-01-2006, 11:00 PM
I have a large string stored in a variable. I want to go through it and pull out all information between two substrings which are table tags.

An example is this
<td>here</td><td>there</td>

I know I will have to loops it as I need, but I would like to pull out all information between the first tag <td> and the very next tag of </td>

Thanks

Nevermind, I found it

Andreas
02-01-2006, 11:33 PM
if (preg_match_all('#<td>(.*)</td>#siU', $html, $cellcontent))
{
echo('Found the following matches:');
print_r($cellcontent[1]);
}