If you want to copy one file at a time and remove the folder name that is stored in the ZIP file, so you don't have to create directories from the ZIP itself, then use this snippet (basically collapses the ZIP file into one Folder).

This is an easy way to extract the zip file into the same directory.<?php
$zip=new ZipArchive();
if($zip->open('sample.zip')==TRUE) {$address=__DIR__;$zip->extractTo($address);$zip->close();
echo 'ok';
}
else{
echo 'failed';
}