hi
please help me by this example.
I have this html code and I want to keep only img tag in td tag
$html='<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div class="big"> SOME HTML CODE HTML CODE <img src="a.jpg"> SOME HTML CODE HTML CODE </div></td>
<td><div class="big"> SOME HTML CODE HTML CODE <img src="b.jpg"> SOME HTML CODE HTML CODE </div></td>
</tr>
</table>';
$html = preg_replace('#<div class="ggg">(.*?)</div>#', '', $html);
echo $html;
output of this code is:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
</tr>
</table>
output that I want must be:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="a.jpg"></td>
<td><img src="b.jpg"></td>
</tr>
</table>
any one can help me by changing in php code?
thanks