//base64图片处理
function base64_image_content($base64_image_content,$filename,$yname,$savepath){
//匹配出图片的格式
if (preg_match('/^(data:s*image/(w+);base64,)/', $base64_image_content, $result)){
$type = $result[2];
$insertfile = ReturnDoTranFilename(null, 0);
$filename = "{$insertfile}.{$type}";
$yname = $savepath . $filename;
if($type=='jpeg'){
$type='jpg';
}
DoChmodFile($yname);
if (file_put_contents($yname, base64_decode(str_replace($result[1], '', $base64_image_content)))){
$pic_o_url = 'https://account.027art.com'.substr($yname,strpos($yname,'/ziyuan'));
return $pic_o_url;
}else{
return false;
}
}else{
return false;
}
}