Created
December 14, 2015 20:58
-
-
Save denisstoyanov/892b780a2e82fa29468e to your computer and use it in GitHub Desktop.
Unzip WordPress (when using FTP)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = 'wordpress-4.2.5.zip'; | |
$path = pathinfo(realpath($file), PATHINFO_DIRNAME); | |
$zip = new ZipArchive; | |
$res = $zip->open($file); | |
if ($res === TRUE) { | |
$zip->extractTo($path); | |
$zip->close(); | |
echo "$file extracted to $path"; | |
} | |
else { | |
echo "Cannot open $file"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment