I wish to check whether or not the $outZipPath
is a valid one. When I have an incorrect drive, such as:
$outZipPath = 'k:/backup.zip' // k drive does not exist
$opened
is still true, hence 'Path created' is always echoed.
How can an incorrect drive/path be checked?
The code is shown below:
$z = new ZipArchive();
$opened = $z->open($outZipPath, ZIPARCHIVE::CREATE);
if ($opened === true)
echo 'Path created';
else
echo 'Not valid path';