1.
function
getNewName(
$imgName
){
2.
$imgName
=
explode
(
'.'
,
$imgName
);
3.
$i
=
count
(
$imgName
)-1;
4.
$name
=
strtolower
(
$imgName
[
$i
]);
5.
$rand
=
substr
(
str_shuffle
(
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'
),0,9);
6.
$result
=
$rand
.time().
'.'
.
$name
;
7.
return
$result
;
8.
}