1. Remove JavaScript annotations
In addition to comments, all other////////*/comments can be safely removed because they do not make any sense to the end-user.
2. Remove white space from JavaScript
such as: x = x + 1; Can be briefly written: x=x+1;.
How to accurately control and judge a "small problem" in PHP, the following is a book excerpt from the statement.
Copy CodeThe code is as follows:
$filename = "Html/cache.txt";
$contents = "I am Zhang Bin";
if (is_writable ($filename)) {
if
Form uploads can only be used in MULTIPART/FORM-DATA encoded format
$_files system functions;
$_files[' myFile ' [' name '] file name
$_files[' myFile ' [' type '] file types, limited by
The method here is to use the Fputcsv write CSV file method, directly to the browser output Excel file.
Copy CodeThe code is as follows:
Output Excel file header, you can replace user.csv with the file name you want
Header ('
The meaning of 1.include_path
When the function include (), require (), Fopen_with_path () function to find the file. When you do not set include_path, these functions open files by default when you look for them in the Web root directory. When
Like what:
The first number is: 1.
Look at the first number you can say a 1, then the second number is: 11.
Look at the second number you can say 2 1, that is, the third number is: 21.
Look at the third number you can say a 2, a 1, that is, the
Copy CodeThe code is as follows:
/*
* Encapsulation: One of the three main characteristics of object-oriented
*
* 1. Is to combine the object's members (attributes, methods) into a separate unit, and hide the inner details of the object as much as
Copy CodeThe code is as follows:
/*
* 1. Access to members of the object (in an internal method of an object, to access the other methods and member properties in this pair of authoritative)
* 2. The method in the object has a $this keyword, which
Copy CodeThe code is as follows:
/* Function Definition:
* 1. The function is a named
* 2. Separate Code Snippets
* 3. Functions perform specific tasks
* 4. And can return a value to the program that called it
*
* Advantages of the function:
* 1.
Copy CodeThe code is as follows:
/**
* Command mode
*
* Encapsulate a request as an object so that you can parameterize the customer with different requests, exclude or log request logs, and support actions that can be canceled
*/
Interface Command
Status state mode is one of the GOF23 modes, as well as the command pattern, which is also a behavior pattern. The state mode and the command pattern are quite similar, and the application of the "interface-Implementation Class" mode is the
Copy CodeThe code is as follows:
/**
* Responsibility Chain Mode
*
* To unbind the sender and receiver of the request, the use of multiple objects takes the opportunity to process the request, linking the objects to a chain and passing the request
Array getimagesize (string $filename [, Array & $imageinfo]) to get the image size
Resource Imagecreatetruecolor (int $x _size, int $y _size) Create a new true color image
Resource Imagecreatefromjpeg (string $filename) Create a new image from a
URL Jump Code
1. Code:
If saved as aaa.php, can realize aaa.php?url=www.baidu.com jump to Baidu effect.
This simple invocation of the default $_get variable. and PHP default jump location:
2. Instance upgrade: Increase if loop
Code:
Copy CodeThe
Configuring the Environment
System: Win7
PHP Version: 5.3.x
MYSQL version: 5.0.27
apache:2.2.4 (WIN32)
Setup method:
Open D:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf
At the end of the add
Namevirtualhost *:80
DocumentRoot "D:\wamp\www\bbs"
Copy CodeThe code is as follows:
Author: The Distant Anticipation
qq:15624575
Algorithm Analysis: 1, must be an integer sequence, 2, if the entire sequence is not all negative, the largest sub-sequence must be a positive number of the first item,
To get the remote file using the PHP curl, the code is as follows:
Copy CodeThe code is as follows:
$ghurl = Isset ($_get[' id ')? $_get[' id ']: ' http://www.baidu.com/';
PHP get
function getcontents ($url) {
$header = Array
The general assignment method cookie that is removed in PHP cookies is often used to identify users. A cookie is a small file that the server leaves on the user's computer. Whenever the same computer requests a page through a browser, it also sends
Learning an array today is one of the more important ways to use PHP data. PHP array functions are numerous, the following is my study of the summary, take this to remember, easy to learn later ...
One, the array definition:The definition of an
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