<?php
header(
'Content-type:text/html;charset=utf-8'
);
$base64_image_content
=
$_POST
[
'imgBase64'
];
//匹配出图片的格式
if
(preg_match(
'/^(data:\s*image\/(\w+);base64,)/'
,
$base64_image_content
,
$result
)){
$type
=
$result
[2];
$new_file
=
"upload/active/img/"
.
date
(
'Ymd'
,time()).
"/"
;
if
(!
file_exists
(
$new_file
))
{
//检查是否有该文