unzip_file

FUNCTION wp-admin\includes\file.php (ligne 1572) github
This filter is documented in wp-admin/includes/file.php  	if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) { 		$archive          = new ZipArchive(); 		$archive_is_valid = $archive->open( $file, ZipArchive::CHECKCONS ); 		if ( true === $archive_is_valid ) { 			$archive->close(); 			return true;

Paramètres

Entrée :
$file, $to
Sortie :
@param string $file Full path and filename of ZIP archive.
@param string $to   Full path on the filesystem to extract archive to.
@return true|WP_Error True on success, WP_Error on failure.

Utilisation

// Utilisation de la fonction unzip_file
$result = unzip_file($file, $to);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...