Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Regular Expression (http://www.go4expert.com/forums/regular-expression-t5894/)

hoangthienphuc 16Aug2007 15:32

Regular Expression
 
I had a html content like this :
HTML Code:

  <tr>
          <td colspan="4">
          <p align="center">
 <img src="chart10.chart?no_cache=5608" %>
  </tr>

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 ( ) ) :confused:
I dont know what's problems here, please help me ( Although i have tried to use preg_match instead of pre_match_all)

pradeep 18Aug2007 13:34

Re: Regular Expression
 
you don't have closing td tag, add that and the regex should work fine!


All times are GMT +5.5. The time now is 15:04.