Jump to content

How to get multiple paragraphs using preg_match


siddscool19

Recommended Posts

Hey people

<td valign="top" class="maintab_back">

				<a href="http://www.phpfreaks.com/forums/index.php?action=help">Help</a>
			</td>
			<td valign="top" class="maintab_back">
				<a href="http://www.phpfreaks.com/forums/index.php?action=search">Search</a>
			</td>
			<td valign="top" class="maintab_back">
				<a href="http://www.phpfreaks.com/forums/index.php?action=profile">Profile</a>

			</td>
			<td valign="top" class="maintab_back">
				<a href="http://www.phpfreaks.com/forums/index.php?action=pm">My Messages </a>
			</td>
			<td valign="top" class="maintab_back">
				<a href="http://www.phpfreaks.com/forums/index.php?action=calendar">Calendar</a>
			</td>
			<td valign="top" class="maintab_back">

				<a href="http://www.phpfreaks.com/forums/index.php?action=mlist">Members</a>
			</td><td valign="top" class="maintab_back"><a href="/page/forum-rules">Rules</a></td>
			<td valign="top" class="maintab_back">
				<a href="http://www.phpfreaks.com/forums/index.php?action=staff">Staff List</a>

Now i want to get data between <td valign="top" class="maintab_back"> and Staff List</a> using preg_match.

I used this coding

The above data is stored in variable $data

preg_match('<td valign="top" class="maintab_back">(.*)Staff List<\/a>/',$data,$newdata);
echo $newdata[1];

But I am not getting any output so what to do?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.