开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜