如何停止preg_match_all返回完整模式匹配数?

时间:2012-05-15 22:51:10

标签: php regex preg-match

我有这段代码来获取所有img标签:

<?php

foreach($design_children as $design_child) {
    echo preg_match_all('/<img[^>]+>/i', $design_child->post_content, $result);
    echo $result[0];
    break;
}

?>

但我一直得到模式匹配号码返回 我的输出像我的图像旁边的2,3 我怎么删除它??? !!

1 个答案:

答案 0 :(得分:0)

删除echo之前的preg_match_all