博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
php替换富文本内图片src
阅读量:3919 次
发布时间:2019-05-23

本文共 376 字,大约阅读时间需要 1 分钟。

/** * @param $content 富文本内容 * @param $path  图片路径 * @return string|string[]|null */public function mergeImageUrl($content, $path){    $url = "https://test.oss-cn-beijing.aliyuncs.com/" . $path;//拼接图片路径    $pregRule = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.jpg|\.jpeg|\.png|\.gif|\.bmp]))[\'|\"].*?[\/]?>/";    $content = preg_replace($pregRule, '', $content);    return $content;}

转载地址:http://fahrn.baihongyu.com/

你可能感兴趣的文章
杭电oj-2006 求奇数的乘积 C++
查看>>
杭电oj-2007 平方和与立方和 C++
查看>>
杭电oj -2009 求数列的和 C++
查看>>
杭电oj-2010 水仙花数 C++
查看>>
杭电oj-2011 多项式求和 C++
查看>>
杭电oj-2014 青年歌手大奖赛_评委会打分 C++
查看>>
杭电oj-2015 偶数求和 C++
查看>>
杭电oj-2016 数据的交换输出 C++
查看>>
杭电oj-2017 字符串统计 C++
查看>>
杭电oj-2018 母牛的故事 C++
查看>>
Educational Codeforces Round 84 ( Div. 2)A. Sum of Odd Integers
查看>>
Codeforces Round #631 (Div. 2)A. Dreamoon and Ranking Collection
查看>>
Educational Codeforces Round 85 (Rated for Div. 2)A. Level Statistics(题解)
查看>>
Educational Codeforces Round 85 (Rated for Div. 2)B. Middle Class
查看>>
Educational Codeforces Round 86 (Rated for Div. 2)---题解(A、B、C)
查看>>
Educational Codeforces Round 87 (Rated for Div. 2)----题目+题解(A、B)
查看>>
Educational Codeforces Round 88 (Rated for Div. 2)A. Berland Poker------题目+题解
查看>>
Educational Codeforces Round 88 (Rated for Div. 2)B. New Theatre Square-------题目+题解
查看>>
Educational Codeforces Round 88 (Rated for Div. 2)C. Mixing Water(数学+二分法)---题解
查看>>
Codeforces Round #646 (Div. 2)B.Subsequence Hate(贪心)---题目+题解
查看>>