base64图片格式:$base64_url = data:image/jpeg;base64,xxxxxxxxxxxxxxxxxxxxxx1,去除头部:$base64_body = substr(strstr($base64_url,','),1);2,解码:$data= base64_decode($base64_body );3,存储or创建图片:file_put_contents($file_path,$data);或$image = imagecreatefromstring($data);例如://解密并保存到指定文件夹中,如果文件夹不存在就创建文件夹并保存到指定文件夹中$base64 = "data:image/jpg;base64,/9j/4AAQSkZJRgA ...... ...... ....... e69/v3f8Aq9f+qPvxpXtrTr3Xv9+7/wBXr/1R96691//Z";$base64_body = substr(strstr($base64,','),1);$img = base64_decode($base64_body);$path = "E:\\\\images\\img\\";if(!file_exists($path)){mkdir($path,0777,true);}file_put_contents($path.time().".jpg", $img);