In PHP, it is an available function to delete the repeated element in an array, that is, array_unique (). However, it is not the most efficient method, and array_flip () is used () the function will be about five times faster than array_uniqure. The
Php array is a very important part of php. you must take a closer look.
The code is as follows:
$ Array = array ("key1" => "Simon", 2 => "Elaine"); // create an arrayEcho $ array ["key1"]; // output SimonEcho $ array [2]; // output Eline?>
Some server information is often used in php programming. I paste the commonly used information in highlighted mode, and the rest will be placed behind it for future reference.
The code is as follows:
$ _ SERVER ['http _ ACCEPT_LANGUAGE '] //
What is PEAR? (Article 3) after managing and installing the basic suite, developers need to install the suite when they need to use a suite other than the basic suite. if they do not need a suite, you will want to remove the suite. if the suite
In PHP, the class and class method names are known in advance, and call_user_func function can be used for dynamic execution. The official manual provides the following examples:
The code is as follows:
// Example of using NameSpaceNamespace
PHPDocumentor is a tool written in PHP. for php programs with standardized annotations, it can quickly generate API documents with functions such as mutual reference and indexing. The old version is phpdoc. 1. what is phpbench entor?
PHPDocumentor
The default session validity period in PHP is 1440 seconds (24 minutes) [weiweiok note: The default value in php5 is 180 minutes]. that is to say, if the client does not refresh for more than 24 minutes, the current session will become invalid.
Today I would like to mention how to configure PHPMyAdmin, because it is widely used by developers. Although it may not be used in the development and debugging of the system on the local machine, Mysql GUI tools such as phpmyadmin will be used for
This is a convenient watermark and thumbnail class, which simplifies some operations and writes parameters according to some CSS habits.
The code is as follows:
/** @ Author sleepless 27262681@qq.com* Copyright http://www.gowake.cn*/Class img
Some people often ask me, I heard that it is faster to process strings in PHP with single quotes. if there is a variable to replace, is it faster to connect with single quotes or double quotes? A simple answer is obviously pale and powerless. Let's
Sometimes we need to obtain the file extension, classification file, and other reasons. The following is the php function instance code.
The code is as follows:
$ File = "/home/lvyaozu/backup_20080115.txt ";For ($ I = 1; $ I $ Func = 'get _ file_
In fact, this leads to the problem of server output control and browser cache, which is a bit complicated and will be studied again later. When uploading and generating a thumbnail, the link displayed by the thumbnail is as follows;
The code is as
Today, I installed the PHP environment in my own book, so I downloaded a phpadmin to manage the database. Many problems are found during the installation process. Now let's make a simple review: we have encountered all the problems. The key is to
After several hours of searching, I finally solved the problem. uploading php files is really a small dish for experts, but it seems helpless for new users. I personally think the idea of uploading and downloading php files is similar. that is, a
This is a constant that defines the Forum installation root directory in discuz. Now let's analyze this simple but practical constant. Define ('discuz _ root', substr (dirname (_ FILE _), 0,-7 ));
This is a constant that defines the Forum
PhpmysqlErrcode: 28 The ultimate solution. if you encounter such problems, refer. Perror 28
Error code 28: No space left on device
SQL statement execution error: SELECT title, gid FROM blog_blog WHERE date Error writing file 'C: \ WINDOWS \ TEMP
By default, the txt text is opened directly in the Mime type setting of the browser. However, if you want to download the text directly, you need to set the Mime. Two processing methods are available on the server side. one is to set in apache, iis,
How to process multiple submit submission forms in php (differentiate different forms) test. php
The code is as follows:
$ Test = $ _ POST ['test'];Echo '12 ';Echo $ test;Echo $ _ POST ['submit1'];Echo $ _ POST ['submit2'];If (isset ($ _ POST ['
In PHP, how does one redirect a page to another? Three methods are listed here for your reference.
1. use HTTP header informationThat is, use the php header function. The HEADER function in PHP is used to send control commands that should have been
It's very easy. I used PHP's method last time. I used it from the class and it can be used directly. you can also continue to improve it. let's take a look at it.
The code is as follows:
/*** Image Upload method* $ Maxsize = 500000 = 500 k;* $
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