最近学习了一个裁剪图片插件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);
}
保存成功!!!!