栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何使用带有PHP的cropit jquery插件裁剪和上传照片

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何使用带有PHP的cropit jquery插件裁剪和上传照片

1.保存base64编码的图像

    <?php    //save your data into a variable - last part is the base64 enpred image    $enpred = "data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhE";    //depre the url, because we want to use depred characters to use explode    $depred = urldepre($enpred);    //explode at ',' - the last part should be the enpred image now    $exp = explode(',', $depred);    //we just get the last element with array_pop    $base64 = array_pop($exp);    //depre the image and finally save it    $data = base64_depre($base64);    $file = 'data.png';    //make sure you are the owner and have the rights to write content    file_put_contents($file, $data);

2.获取base64编码图像的文件名

    $enpred = "data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhE";    $depred = urldepre($enpred);    $exp = explode(';', $depred);    $exp = explode(':', $exp[0]);    $image = array_pop($exp);    echo ($image);


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/387977.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号