获取文件后缀
protected function _getExtension($fileInfo){
$fileName='';
if($fileInfo){
foreach($fileInfo as $value){
$fileName=$value['name'];
}
$exts=preg_split("[/.]",$fileName);
$n=count($exts)-1;
$exts=$exts[$n];
return $exts;
}
}
生成随机密码
protected function _makePassword($length){
$possible="0123456789!@#$%^&*()_+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$str="";
while(strlen($str)<$length){
$str.=substr($possible,(rand() % strlen($possible)),1);
}
return ($str);
}