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));
lnmp 报错 open_basedir restriction in effect解决办法
vim /usr/local/php/etc/php.ini
centos 下编译安装fileinfo扩展
./configure -with-php-config=/usr/local/php/bin/php-config
extension=fileinfo.so
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
解决编译安装php时报错:Please reinstall the iconv library
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
第一:配置php.ini,timezone是Asia/Shanghai
第二:Laravel的/app/config/app.php 配置文件’timezone’ => ‘Asia/Shanghai’
laravel admin 配置阿里云oss
composer require jacobcyl/ali-oss-storage:dev-master