Regular Expression

hoangthienphuc's Avatar, Join Date: Mar 2007
Go4Expert Member
I had a html content like this :
HTML Code:
           <td colspan="4">
           <p align="center">
 <img src="chart10.chart?no_cache=5608" %>
and i saved the above content in $content
I used :
PHP Code:
 preg_match_all("/(<td colspan=\"4\">(.*?)<\/td>)/",$content$match); 
and then print_r($match);
and it display : Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) )
I dont know what's problems here, please help me ( Although i have tried to use preg_match instead of pre_match_all)

Last edited by pradeep; 18Aug2007 at 13:27.. Reason: Code formatting
pradeep's Avatar, Join Date: Apr 2005
Team Leader
you don't have closing td tag, add that and the regex should work fine!