首页  >  问答  >  正文

$func 是什么意思,怎么来的

        $func = 'image'.$type;
        
        //处理path路径 是否启用随机文件名    
        if($isRanName)
        {
            $name = uniqid().'.'.$type;
        }else{
            $pathinfo = pathinfo($soruce);
            //var_dump($pathinfo);
            
            $name = $pathinfo['filename'].'.'.$type;
        }
        
        $path = rtrim($path,'/').'/'.$name;
        
        $func($soruceRes,$path);
        
        imagedestroy($soruceRes);
        
        imagedestroy($waterRes);
        
    }

LiuBoLiuBo2586 天前1755

全部回复(1)我来回复

  • PHP中文网

    PHP中文网2017-08-24 18:07:17

    $func = 'image'.$type;
    $func($soruceRes,$path);


    $func是动态拼接的函数名。

    回复
    0
  • 取消回复