博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
php url图转base64编码
阅读量:3921 次
发布时间:2019-05-23

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

/** * 网络图转base64编码 * @param img 图片网址 **/public function imgToBase64($img = ''){    if (!$img) {        return false;    }    $imageInfo = getimagesize($img);    $base64 = "" . chunk_split(base64_encode(file_get_contents($img)));    return 'data:' . $imageInfo['mime'] . ';base64,' . chunk_split(base64_encode(file_get_contents($img)));}

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

你可能感兴趣的文章
服务器多块网卡绑定后,bond没有起来
查看>>
Nginx安装的前期准备工作
查看>>
nginx 编译参数详解
查看>>
安装nginx
查看>>
Linux之history指令
查看>>
行首行尾字符^$
查看>>
Linux中的. 和*字符
查看>>
linux sed命令详解
查看>>
Shell脚本基本信息
查看>>
xz压缩命令
查看>>
source、sh、bash、./执行脚本的区别
查看>>
centos7安装Apache虚拟主机
查看>>
Job for network.service failed
查看>>
在同一个网络接口上绑定多个IP
查看>>
TreeMap源码分析(基于jdk1.8)
查看>>
中介者模式
查看>>
全面理解java内存模型
查看>>
访问者模式
查看>>
设计模式之适配器模式
查看>>
面试官:手写一个选择排序并对其改进(java实现)
查看>>