<?php
$string = "http://giphy.com/static/img/homepage_banners/snl-leslie.gif";
$find_images = preg_match("/(https?:\/\/\S+\.(?:jpg|png|jpeg|gif))\s+/", $string, $matches) ? $matches[1] : "";
if(@is_array(getimagesize($find_images))) {
// Check if image exists
echo $find_images;
}
?>
我尝试回显图像链接,但我的正则表达式找不到图像的链接。 ???有人能帮我吗?提前谢谢
答案 0 :(得分:2)