/**
* 生成一个随机的图片名
* param $type 文件名的后缀
*/
if(!function_exists('get_image_file_name')) {
function get_image_file_name($type = 'png') {
if (in_array($type, ['png', 'jpg', 'jpeg'])) {
return time().rand(1,99999).'.'.$type;
}
return '';
}
}
智享笔记