$upload->saveName使用函数的问题

浏览:5219 发布日期:2014/07/21 分类:求助交流 关键字: $upload->saveName
设置了 $upload->saveName = 'guid';

在common的function.php里也加了guid函数function guid(){
   if (function_exists('com_create_guid')){
       return com_create_guid();
   }else{
       mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
       $charid = strtoupper(md5(uniqid(rand(), true)));
       $hyphen = chr(45);// "-"
       $uuid = chr(123)// "{"
               .substr($charid, 0, 8).$hyphen
               .substr($charid, 8, 4).$hyphen
               .substr($charid,12, 4).$hyphen
               .substr($charid,16, 4).$hyphen
               .substr($charid,20,12)
               .chr(125);// "}"
       return $uuid;
   }
}
为什么上传的文件却是guid.jpg 不是调用guid函数呢
最佳答案
评论( 相关
后面还有条评论,点击查看>>