php 正则获取图片url
php 正则获取图片url
preg_match_all(“/(src)=[\”|\”| ]{0,}(http:\/\/(.*)\.(gif|jpg|jpeg|bmp|png|JPEG|GIF|PNG))[\”|\”| ]{0,}/isU”, $content, $match);
其实我一直在你身边
php 正则获取图片url
preg_match_all(“/(src)=[\”|\”| ]{0,}(http:\/\/(.*)\.(gif|jpg|jpeg|bmp|png|JPEG|GIF|PNG))[\”|\”| ]{0,}/isU”, $content, $match);
php 生成2个字母或数字组合
$chars = “abcdefghijklmnopqrstuvwxyz0123456789”;
$str .= $chars[mt_rand(0, $lc)];
php 获取文件后缀
$suffixArr = explode(‘.’,$url);
return end($suffixArr);
laravel 上传阿里云oss
OSS::publicUpload(config(‘app.oss_bucket’),$targetName,storage_path(‘app/’.$imgName));