获取URL
$url = "http://www.nowamagic.net/index.html";
preg_match("/^(http:\/\/)?([^\/]+)/i", $url, $matches); 
print_r($matches['0']);
获取图片地址
$str = "<p><img src='/data/upload/meinv/2016/09/meinv_2016090216224620142ae2baeee8f44d36b3eea01a870c.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_2016090221322097e8532da44506df8d3a3c8a03f9663e.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_201609022135394ee7d4eb9d457a0555a5b84a23c3586e.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_20160902213522a9e5bcd90fad7e02dcea58a17d5af39b.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_20160902213514e657e6f665a13034d31cd187c8ce1101.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_201609022135094a52bc60996292565257a5a0c97ffc2d.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_201609022132373677c34ce9d8a180da33e44092cf70da.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_20160902213228dfb3037aa666e44456f353138c7cd2a9.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_201609022132220a0c649bca9757e767ccb18cfee749da.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>_ueditor_page_break_tag_<p><img src='/data/upload/meinv/2016/09/meinv_20160902213221d99342b311cbf2b79ce6e94f805e02e3.gif' alt='斋藤飞鸟gif动态图合集 好甜美的混血美女斋藤飞鸟'></p>";

$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/"; 
preg_match_all($pattern,$str,$match); 
print_r($match); 

nginx 解析php conf配置文件

本博客的nginx 配置文件 server { listen 80;#80和443端口同时监听 listen 443 ssl; server_name www.koukousky.com koukousky.com...

阅读全文

php composer 安装阿里云镜像

#doc: https://developer.aliyun.com/composer 全局配置(推荐) composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 取消配...

阅读全文

intervention/image处理IOS上传图片翻转问题

#安装 $ composer require intervention/image <?php use Intervention\Image\ImageManagerStatic as Image; //test.png要处理的图片路径 Image::make(&...

阅读全文

欢迎留言