$imageName = "25220_".date("His",time())."_".rand(1111,9999).'.png'; //图片名称
$image = $_POST['uploads']; //APP传过来的 base 64 字符串
$path = __DIR__.'/sign/'.date("Ymd"); //获取文件目录
if (!is_dir($path)){ //判断目录是否存在 不存在就创建
mkdir($path,0777,true);
}
$imageSrc= $path."/". $imageName; //图片名字
$r = file_put_contents($imageSrc, base64_decode($image)); //返回的是字节数
if (!$r)
{
$data['error'] = '签名上传失败';
$data['success'] = 0;
}
else
{
$data['data'] = '签名上传成功';
$data['success'] = 1;
}