php - How to check if file exist in zip archive -
i have zip archive , after extract him need check if moduleconfig.xml exist inside zip archive. how can that.
i try this
$zip = new ziparchive(); if($zip->open('test.zip') === true ) { if(file_exists($zip->getfromname('moduleconfig.xml'))) { echo "config exists"; // somthing } } else { echo 'failed code:'. $res; }
it should this:
$zip = new ziparchive(); if($zip->open('test.zip') === true ) { if ($zip->locatename('moduleconfig.xml') !== false) { echo "config exists"; } } else { echo 'failed code:'. $res; }
Comments
Post a Comment