The zip file can be decompressed. It has two parameters: the path to the compressed file, and the path to the destination file.
function Unzip_file ($file, $destination) {
Create Object
$zip = new Ziparchive ();
Open
A very simple function to generate a. csv file from a PHP array. This function uses the Fputcsv PHP built-in function to generate a comma-delimited file (. CSV). The function has 3 parameters: data, delimiters, and CSV enclosure, which are double
PHP Paging code calls: $start =show_page ($query, $page, $link, $offset); Where: $start is the starting record $query the SQL statement is retrieved for the full record $page is the page parameter passed for the current page number $link Offset
php traverse all files and folders under a folder
function List_dir ($di rpath) {
if ($dirpath [strlen ($dirpath) -1]!= "\ \") {$dirpath. = "\ \";}
static $result _array=array ();
if (Is_dir ($dirpath)) {
$
About PHP generated certificate key information is really very few ah, check for a long, finally in the official documents found relevant information, and according to their own understanding, organized into the following code, divided into two
Generate a certain number of non-repeating random numbers
/*
* Array Unique_rand (int $min, int $max, int $num)
* Generate a certain number of non-repeating random numbers
* $min and $max: Specify the
The following code implements the 301 redirect, 301 redirect is a SEO friendly redirection method, its intention is to tell the search engine now access to the content has been transferred to another address.The following is a PHP implementation of
PHP Common Date function Summary: including check the date format is legitimate, check whether the time is legitimate time, time comparison function, return two date a few seconds, minutes, hours or days.
function Check_date
/**
* Picture shrinkage Water printing type
*
* @version 1.0;
*
*/
Class Cls_photo
{
protected $waterrate = 0.2; The scale of the watermark icon on the picture
protected $width = 300; Thumbnail default
Image upload
$max _file_szie=2*pow (2,20); The uploaded file is less than 2MB
$destination _folder= ' uploadimg/'; Upload File Save path
if ($_server[' Request_method ']== ' POST ') {
if
PHP calculates the size of the connected MySQL database, which is returned in MB,KB or GB format
function Calcfulldatabasesize ($database, $db) {
$tables = Mysql_list_tables ($database, $db);
if (! $tables) {return-1;}
In this paper, we describe the simple game of minesweeper implemented by PHP. Share to everyone for your reference. Specific as follows:
$init = $_post["init"];//game restart
$clickvalue =
In Web application development, people often use the session to store data. However, some people may not know that in PHP, the use of the session may cause concurrency problems. Plus91 Technologies Senior Engineer Kishan Gor, a software solutions
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service