PHP获取文本内容中的图片

/**
 * 获取内容中的图片
 * @param string $content 内容
 * @return string
 */
function match_img($content){
    preg_match('/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/', $content, $match);
    return !empty($match) ? $match[1] : ''; 
}
PHP获取文本内容中的图片
© copyright statement
THE END
If you like it, support it.
kudos8 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments