PHP deletes the array elements in a specific way:
1. Using the Unset () method:Copy the Code code as follows:
$a =array ("Red", "green", "blue", "yellow");Count ($a); Get 4unset ($a [1]); Delete the second elementCount ($a); Get 3echo $a [2];
Control floating-point printing formatThe print and format control of floating-point numbers is a common feature of sprintf, and floating-point numbers use the format "%f" control, which retains 6 digits after the decimal point by default, such as:
Using PHP for two days Snoopy this class, found very useful. Get all the links in the request page, use Fetchlinks directly, get all the text information using Fetchtext (which is handled internally or using regular expressions), and more features
The PHP Setcookie () function sends an HTTP cookie to the client. A cookie is a variable that is sent to the browser by the server. A cookie is usually a small text file that the server embeds into a user's computer. This cookie is sent whenever the
MCrypt Brief Introduction
PHP Programmers in the code program, in addition to ensure the high performance of the code, there is one thing is very important, that is the security of the program. In addition to several cryptographic functions, PHP
Ajax cross-domain solution, Ajax cross-domain
Recently, in the development process, Ajax was used to extract images asynchronously. In the development of this feature is not a problem, you can later to test, re-deployment after the problem, this is
For example, the following Web app may display sensitive information to logged-in users:
Copy the Code code as follows:
$authenticated = FALSE;
$authenticated = Check_auth ();
if ($authenticated)
{
Include './sensitive.php ';
}
?>
Because
A concise summary of the Magic method in the PHP class, Magicmethod
1. __construct () and __destruct ()
It is called when the instance is created/destroyed, and can pass 0 or more parameters.
Class A { function a () { echo "build a"; }
PHP implementation method to get Picture color value
This example describes the PHP implementation of the image color value of the method, PHP get Image Color value detection image The main color is through the Imagecreatefromjpeg function to read
The default first page announcement in Destoon is called as follows:
Copy the Code code as follows:
$today _endtime-86400&areaid= $cityid &pagesize=3&datetype=2&order= Listorder desc,addtime Desc&target=_blank ")}–>
The template file referenced
PHP NG (PHP 5.7) performance is nearly 1 time times faster than PHP5.6
PHP NG (PHP 5.7 If you want to) is still in the alpha development phase, but it has shown amazing performance gains. The key is to still maintain compatibility with PHP
Two-dimensional code online generation of images PHP source code
QR code is now becoming more and more popular, here is the two-dimensional code generated by PHP code, a use of Google's open QR Code API, another section of the use of PHP QR code
What is a label call?
The label call is to read the call quantity (pagesize) bar data from the Data table (table) according to the invocation criteria (condition) and sort by sort (order), eventually outputting the data through the layout of the
The GetField method is the method used in thinkphp to get field values, as distinct from the Select and find methods, and is typically used only to get the values of individual fields. But in fact it is not that simple, now the usage of the method
The PHP qualifier is intended to output content as such. It has the following format:
Copy CodeThe code is as follows:
$str = Here is your string
......
EOF;
Where EOF is a custom variable, but to appear in pairs!
Attach a sample PHP code:
Copy
PHP Curl Encapsulation Class Use example
We need to open the PHP Curl module before using the function (Libeay32.dll, Ssleay32.dll, Php5ts.dll, Php_curl.dll)
To open the PHP Curl Library
1). Remove the Windows/php.ini file; Extension=php_curl.dll
Implement a simple MySQL-weighted Chinese full-text search
I am writing a web, want to do full-text search database. But Google learned that because of Chinese word segmentation, MySQL only support full-text search in English, want to support
PHP sorts the numeric values, uses another container, sorts the PHP array
PHP sorts values in pairs, using another container
Php/*Sort by: actually only need to loop the array to do n cycles, and then take the maximum value each
Java,java official website
Java
int[] array1 = {1,3,5,7,9,10,2,15,154,10,2,188,200};//defines an array with the contents of a chaotic size intindex = 0;//defines the position of a maximum or minimum value intKeyValue =
PHP5.3 and 5.5 obsolete and outdated functions are summarized, php5.35.5
Many PHP programmers know that a new error level has been added from PHP5.3 to deprecated, which is about to be discarded/expired. Let's comb a version of this.
The functions
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