|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-03-18 12:38 UTC] remi@php.net
-Status: Open
+Status: Not a bug
[2020-03-18 12:38 UTC] remi@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
Description: ------------ Documentation for ZipArchive::getFromName is misleading. The first parameter is actually a relative (to root of the archive) path, docs say "Name" which can falsely imply file would be found just by its filename, which doesn't happen when it is inside a directory. To get to a deeper file, you must specify the path like: $zip->getFromName('subFolderTest/test.txt'); --- From manual page: https://php.net/ziparchive.getfromname --- Test script: --------------- //considering archive structure //subFolderTest (d) // - test.txt (f) // - test2.txt (f) $zip->getFromName('test.txt'); //this will not find anything $zip->getFromName('subFolderTest/test.txt'); //this will find the file