Hi all,
I am dealing a small issue. I am missing something silly :). My need is that I want the entire lines between <TABLE> </TABLE> with no modifications.

<?php

$some_string = <<<STR
<HR noShade size=2>
<TABLE  BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR="" >
<TR BGCOLOR="c1ffcc">
<TH ALIGN="LEFT" COLSPAN=22>
<font face="Arial,Helvetica,Geneva,Swiss,Verdana" size="2" color="black">Baseline Comparison for Request Id: </font></TH>
</TR>
<TR BGCOLOR="lightblue">
<TH COLSPAN=1>
</TH>
</TABLE>
</body>
</html>
STR;

$match = preg_match('`<TABLE  BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR="" > (.*)</TABLE>`i', $some_string,$table);

echo $match;

print_r($table);

But this code doesn't fetch me the desired output. Any help will be highly appreciated.

What is the output you get, and what is the output you want ?

If you look at the manual, you can see that $match is an integer. If you want to get the text, you'll need to use $table[1] (assuming your regex is correct).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.