$pattern='/<img.*?(?: |\\t|\\r|\\n)?src=[\'"]?(.+?)[\'"]?(?:(?: |\\t|\\r|\\n)+.*?)?>/sim'; preg_match_all($pattern, $content, $match, PREG_PATTERN_ORDER); $content:要匹配的字符串 $match:匹配的结果数组