最近学习了一个裁剪图片插件cropme.

图片裁剪之后以base64保存的。

$file_path 图片保存的路径
public static function stringBase64ToImage( $image_base64, $file_path)
{
list($type, $image_base64) = explode(';', $image_base64);
list(, $image_base64) = explode(',', $image_base64);
$image_base64 = base64_decode($image_base64);
file_put_contents($file_path, $image_base64);
}
保存成功!!!!


本文介绍了一种使用cropme插件进行图片裁剪的方法,并详细展示了如何将裁剪后的图片以base64格式保存,最后通过提供的函数将base64字符串转换为图片文件。
1959

被折叠的 条评论
为什么被折叠?



