In the company encountered a problem, is the use of Zip packaging users upload files, to provide collective download.--The first idea is to use exec to package Linux. But ... exec method, you know, I'm not very willing to use this function.--So the internet search, the result is, I underestimated PHP for the operation of Io, to my lesson is, what future problems should be considered how to solve from the code
C #4.0 new features (4) New LINQ Extension Method-zip ()
1. Introduction
The so-called zip (Chinese indicates a zipper) is to stitch two lists together like a zipper. There is a zip function in Python that can be used to conveniently merge two or more sets, for example:
Code
Linux Install PHP extension zip module for everyone to learn reference. 1. Run the following command sequentially:
wget http://pecl.php.net/get/zip-1.8.10.tgz
#tar zxvf zip-1.8.3.tgz
#cd zip-1.8.3
#/opt/php/b
Note the following when installing zip extension in xampp in linux: 1. When installing xampp, the following error occurs: grep:/opt/lampp/include/php/main/php. h: No such file or directory grep:/opt/lampp/include/php/Zend/zend_modules.h: No such file or directory grep: /opt/lampp/include/php/Zend/zend_extensions.h: No such file or directory authentication ing for: PHP Api Version: Zend Module Api No: Zend
Affected Versions:MandrakeSoft shortate Server 4.0 x86_64MandrakeSoft shortate Server 4.0PHP 5.x
Vulnerability description:
PHP is a widely used scripting language. It is especially suitable for Web development and can be embedded into HTML.
The PHP "Zip" extension "stream_get_contents ()" function has a denial of service vulnerability. Remote attackers can exploit this vulnerability to cause application
This article is mainly for you to introduce in detail the use of PHP zlib function, easy to implement PHP file package download zip, with a certain reference value, interested in small partners can refer to
The example of this article for everyone to share the php file package download zip code for everyone to refer to, the specific content as follows
PHP zi
JS mobile phone number, zip code, area code, ID card Verification program
Mobile phone Number Inquiryfunction Checkmobile () {var smobile = Document.mobileform.mobile.valueif (!) ( /^13[0-9]d{4,8}$/.test (Smobile))) {Alert ("Please enter your mobile number (at least the first 7 digits)");Document.mobileform.mobile.focus ();return false;}}Postcode inquiryfunction
Php zip compression code
$ Error = ""; // error holder
If (isset ($ _ POST ['createpdf ']) {
$ Post =$ _ POST;
$ File_folder = "files/"; // folder to load files
If (extension_loaded ('Zip') {// Checking zip extension is a
provide the rar-related function, you need to seek help from a third-party function.
Fortunately, this PECL (The PHP Extension Community Library)
There is a rar package available for use.
However, you must install it manually.
For Unix, refer to the following installation method:
Fetch http://pecl.php.net/get/rar-x.x.x.tgz
Gunzip rar-xxx.tgz
Tar-xvf rar-xxx.tar
Cd rar-xxx
Phpize
./Configure make install
Of course, if freebsd is used, port installa
In specific Web site programming projects, sometimes you need to use PHP script code to control the compression and decompression zip file. The following is a simple PHP zip decompression implementation code, the need for friends can refer to the next careful study of a bit.
After PHP installation comes with a
PECL (The PHP Extension Community Library)There is a rar package available for use.However, you must install it manually.For Unix, refer to the following installation method:
Fetch http://pecl.php.net/get/rar-x.x.x.tgzGunzip rar-xxx.tgzTar-xvf rar-xxx.tarCd rar-xxxPhpize./Configure make install
Of course, if freebsd is used, port installation will be faster.
Cd/usr/ports/archivers/pecl-rarMakeMake install
Remember to restart apache after installatio
related functions, so need to help third-party functions to use
Fortunately there is this PECL (the PHP Extension Community Library)
There is a RAR package can be used
But it has to be installed manually.
If Unix, you can refer to the following installation method
Fetch HTTP://PECL.PHP.NET/GET/RAR-X.X.X.TGZ
Gunzip rar-xxx.tgz
TAR-XVF Rar-xxx.tar
CD rar-xxx
Phpize
./configure make make install
Of course, if FreeBSD, it would be quicker to use port
Zip:pclzip http://www.phpconcept.net/pclzip/index.en.php
rar:pecl rar Http://pecl.php.net/package/rar
In the past to perform the decompressor under PHP, the most common way is to write command and then use EXEC () and other execution functions to run
This may be possible under Windows, but switching to UNIX can be a problem for account permissions and cannot be executed successfully
Is there a way of providing a function that can be used directly without having to go to the command to run?
The a
functions to use
Fortunately there is this PECL (the PHP Extension Community Library)
There is a RAR package can be used
But it has to be installed manually.
If Unix, you can refer to the following installation method
Fetch HTTP://PECL.PHP.NET/GET/RAR-X.X.X.TGZ
Gunzip rar-xxx.tgz
TAR-XVF Rar-xxx.tar
CD rar-xxx
Phpize
./configure make make install
Of course, if FreeBSD, it would be quicker to use port.
Cd/usr/ports/archivers/pecl-rar
Make
Make in
Php detects common code classes (such as zip and rar) of file types through the file header ). Sometimes this is not perfect. Some people may store some files, but they modify the extension to make it within our file type. It cannot be displayed during a single access (sometimes we are not doing well. Some people may store some files, but they modify the
Sometimes we don't do it well. Some people may have saved some files, but he has changed the extension so that it is within our file type. Cannot be displayed when a single actual visit (because the extension does not match the contents of the file). The following PHP class may be helpful to us.
First, the PHP detection class
First of all, the above file header and file type mapping relationship from the In
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.