quick problem with regular expressions
I'm having trouble stripping this piece of HTML:
title="External Link" alt="External Link"/></h5>
</a>
This text is needed without the spaces..
</div>
Here is the general method I attempted:
$array = array();
preg_match( '/<\/h5>(.*?)
/si', $data, $array ) ;
I just can't seem to crack it.
Any help would be appreciated,
Thanks!
开发者_运维问答P.s The text may also contain html tags itself, such as <em> or <strong>
This should work.
preg_match('#</h5>\s*</a>\s*(\w.+)\s*</div>#Uis', $data, $array);
精彩评论