note 50334 added to function.zip-entry-filesize
| From: | jay dot kamminga at home dot nl | Date: | Fri, 25 Feb 2005 00:19:54 +0000 |
| Subject: | note 50334 added to function.zip-entry-filesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85510@lists.php.net to get a copy of this message | ||
I needed the following code myself, perhaps someone else needs it too:
<?php
function zip_entry_filetype($zip_entry) {
// What is the filename?
$filename = zip_entry_name($zip_entry);
// If the filename contains a dot (".") return everything behind the dot.
if (strstr($filename, ".")) $filetype = preg_replace("/^(.*?)\.([^\.]+)$/",
"\\2", $filename);
// If not so, return file (unkown, any file)
else $filetype = "file";
return($filetype);
} // zip_entry_filetype.
?>
Hope this comes in handy to anyone.
Greetings, Jay
----
Manual Page -- http://www.php.net/manual/en/function.zip-entry-filesize.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50334
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50334&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50334&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50334&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50334&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50334&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50334&report=yes
Search -- http://master.php.net/manage/user-notes.php