Horrid
Programmer
- May 20, 1999
- 373
I have never managed to work out how to structure regular expressions and could use some help explaining how and why you would construct a regular expresion to extract the content between 2 html tags.
The tags are <td id=(a numerical value)>(text I want)</td>
I tried this
$r=preg_split("<td id\=(.*)/td>", $res);
while (list ($key, $val) = each ($r))
{
echo "$key => $val
";
}
and didn't get an error for a change but the output I got was 0=>> 1=>>. All my efforts have failed.
Thanks for any help.
The tags are <td id=(a numerical value)>(text I want)</td>
I tried this
$r=preg_split("<td id\=(.*)/td>", $res);
while (list ($key, $val) = each ($r))
{
echo "$key => $val
";
}
and didn't get an error for a change but the output I got was 0=>> 1=>>. All my efforts have failed.
Thanks for any help.