1. Upgrade PHP to the latest version.The simplest way to improve performance is to constantly upgrade and update the PHP version.
2. Use Analyzer
There are many reasons for slow website operation, Web ApplicationsProgramExtremely complex and
CodeAs follows:
Copy codeThe Code is as follows: $ dir = 'd: \ Program Files \ resource \ Application \ skin \ PNG \ '; // pay attention to the path here, and add two \, the first one indicates conversion, but it is easy to encounter other specific
CopyCodeThe Code is as follows: $ Arr = array (234 );
$ N = count ($ ARR );
For ($ I = 1; $ I // Why $ N-1 is calculated because the array starts from 0?
// Next is the first internal loop
For ($ J = $ n-1; $ J >=$ I; $ j --)
{
// If $ arr [10]
CopyCode The Code is as follows: /**
* Data Access Object example
*
* @ Create_date: 2010-01-04
*/
Class basedao{VaR $ _ DB = NULL;VaR $ _ TABLE = NULL;
Function basedao ($ config){$ This-> _ DB = new mysqldb (); // operation not allowed here}
I don't know how to write the original article into the essay.
All right, the first blog.
There are three types:
1. filter input (lightweight)
Class input_filter
Filters parameters, such as $ _ GET and $ _ POST.
The return value type is an array and
Copy codeThe Code is as follows: // Post. php
Function Post ($ host, $ port)
{
// $ Host = "127.0.0.1 ";
// Establish a connection
$ Conn = fsockopen ($ host, $ port );
If (! $ Conn)
{
Die ("Con error ");
}
// Send data 5 times in a loop
//
For ($ I
Search for a specific value in the array. If yes, return TRUE. Otherwise, return FALSE.
Boolean in_array (mixed needle, array haystack [, boolean strict])
Find a specified key in the array. If yes, return TRUE. Otherwise, return FALSE.Boolean array_
First, clarify the PHP engineering question I mentioned. After graduation, I used PHP for WEB system development and did not work in the language. Work experience is about 3 ~ In the past four years, the development of common WEB Systems (Millions
Of course, this article is not about researching Chinese search engines, but about using PHP as an in-site search engine. This is an article in this system.
The word segmentation tool I used is the open-source ICTCLAS version of the institute of
Copy codeThe Code is as follows: // Yang Hui triangle
For ($ I = 6; $ I> = 0; $ I --)
{
For ($ j = $ I; $ j {
If ($ j {
Echo " a ";
} Else
{
Echo " ";
}
}
}
?>
PHP print Yang Hui triangle customCopy codeThe Code is as follows: ">Level of the input
As a result, the setcookie setting does not take effect and is not displayed on the browser. After checking, it turns out that setcookie is implemented through the HTTP request response Header and needs to be executed before the request response
Copy codeThe Code is as follows:/* function array_map () function: Multi-array callback function-calls the callback function to the unit of the given array.
* 1. Syntax: array array_map (callback, array arr1 [, array...])
* 2. Description: return an
1. Super simple page Cache
If your project is not based on a CMS system or framework, creating a simple cache system will be very practical. The following code is very simple, but it can solve problems for small websites.
Copy codeThe Code is as
In Unix, The nohup command function means to run the command without hanging up, while nohup puts all the output of the program to the current directory nohup. out file. If the file cannot be written, put it in /nohup. out file. With this command,
Function bool array_multisort (array & $ arr [, mixed $ arg = SORT_ASC [, mixed $ arg = SORT_REGULAR [, mixed $...])
Parameter description: The function sorts multiple arrays or multi-dimensional arrays.
The first parameter is an array, and each
1. Meaning of include_path
When the include (), require (), and fopen_with_path () functions are used to find files. without setting include_path, when these functions open files, the web root directory is used by default. after setting
Copy codeThe Code is as follows: /**
* Builder Mode
*
* Separates the construction of a complex object from its representation. Different representations can be created using the same construction process.
*/
Class Product
{
Public $ _ type =
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