PHP 8.5.0 Alpha 4 available for testing

Voting

: max(seven, one)?
(Example: nine)

The Note You're Voting On

tahazit dot co dot il at gmail dot com
10 years ago
On PHP >5.4, This function will create a file, not a directory.

For instance:

$zip->addEmptyDir ( 'path/to/dir/' );

will create the folders "path/", and "path/to/", and a dummy 0-byte file named "dir" in the latter.
If then we add a file to that dir, say like this:

$zip->addFromString ( 'path/to/dir/file.txt', $data );

the result will be a SEPARATE folder named "dir" next to the dummy "dir" file. The "dir" folder will contain the file "file.txt".

This was tested on an APACHE server running PHP 5.4

<< Back to user notes page

To Top