Hey, I need to find a way to get the contents of a particular web page...
The contents i want to match are like this:
<b><font size=2>CONTENTS (some <BR> tags)</font></b>. I've tried lots of regex strings but none of them seem to work. I need to figure out what CONTENTS is.
preg_match('#<b><font size=2>(.*)</b>#', $html, $matches);
echo $matches[1];
and nothing seems to happen.
Any help is appreciated.
Regex...
Moderator: General Moderators
Re: Regex...
thundza wrote:
The contents i want to match are like this:
<b><font size=2>CONTENTS (some <BR> tags)</font></b>. I've tried lots of regex strings but none of them seem to work. I need to figure out what CONTENTS is.
The easiest: use substr and strpos to grab it from $page
Use strpos to determine where <b><font size=2> is.
Then take substr to remove <b><font size=2> and everything before it.
Now use strpos where </font></b> is.
Then take substr and remove everything from </font></b>
done