Delete zip file in yii

Delete Zip Files Using PHP

Here i added this code to delete the zip files inside the folder of yii framework.
SourceCode:


public function actionDeletefile($id,$docid)
{
    $error='';
    
    $filepath=Yii::app()->basePath.'/files/'.$zipfilename.".zip";   
    $zip = new ZipArchive;
    if ($zip->open($filepath) === TRUE) 
    {
        $zip->deleteName($filename); // this file of inside zip folder     
    } else{
        $error='failed';
    }
    $zip->close();                 
}