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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -