The main points of the singleton pattern are three:One is that a class can have only one instance;
The second is that it must create this instance on its own;
Thirdly, it must provide this instance to the whole system on its own.
Copy CodeThe code
The Define () function defines a constant.
The purpose of the Define () function is to define a constant.
Constants is much like variables, except for the following differences:constants [constant] and variables [variable] have many similarities,
PHP AutoLoad Mechanism detailed(1) AutoLoad mechanism overviewWhen developing a system using the PHP OO model, it is often customary to store the implementation of each class in a separate file, which makes it easy to reuse the classes and
Buffer----Flush ()
Buffer is a memory address space, the Linux system default size is generally 4096 (1KB), that is, a memory page. It is primarily used to store data between devices that are out of sync or between devices with different priority
Header Common DirectivesThe header is divided into three parts:The first part is the version of the HTTP Protocol (http-version);
The second part is state code (status);
The third part is the reason phrase (reason-phrase).
Fix 404 Pages: Use this
We know that if the password is hashed directly, then the hacker can get a hash value by obtaining this password, and then by checking the hash value dictionary (for example, MD5 password cracking site), the password of a user.
Adding salt can
When you want to debug with PHP logging, or an AJAX request error. We generally write information to a specified file
Of The problem is then handled according to the appropriate information.
For example, I like to use Ajax do not get data, in the
ODBC Connection class functionsOdbc_connect function: Open an ODBC connection
Odbc_close function: Closes an ODBC connection that is already open
Odbc_close_all function: Close all ODBC connections that are already open
Odbc_pconnect function: Open
Although you can use a similar technique to reject oversized files (by checking the $uploadedfile_size variable), this is usually not a good idea. Before this variable is obtained, the file has been uploaded and saved in the temp directory. If you
Scenario 1:
Father.php is defined as follows:
Copy CodeThe code is as follows:
$jack = 1000;
?>
Children.php is defined as follows:
Require ("father.php");
$jack = 123;
echo $jack. " /n ";
?>
PHP children.php
The run output is 123.
If $jack=123
[PHP]; PHP is also a constantly evolving tool, and its functionality is constantly being truncated.
; And PHP.ini's settings change can reflect a considerable change,
; It's good to study php.ini before using the new PHP version.
;;;;;;;;;;;;;;;;;;;
First of all, we need to understand the principle of IP address conversion to integer (strictly speaking, long integer type) ~
"Principle of conversion": assuming that IP is: w.x.y.z, the IP address to integer number is calculated as: Intip = 256*25
Use the PHP implementation to calculate the year, month, week, and day of two date intervals:
Copy CodeThe code is as follows:
function format ($a, $b) {
Check the two date size, the default is small after large, if the former large after the
Assume that the installation directory for Hadoop is Hadoop_home/home/admin/hadoop.
Start and closeStart Hadoop1. Enter the Hadoop_home directory.
2. Execute SH bin/start-all.sh
Turn off Hadoop1. Enter the Hadoop_home directory.2. Execute SH
The weather finally cleared up, but the problem came. In the implementation of user data synchronization between two sites, when using PHP function file_get_contents Crawl Execution Remote page, if the connection timeout will output a fatal error or
Data structure is important, algorithm + data structure + document = Program
using PHP to describe the bubbling sorting algorithm, an object can be an array
Copy CodeThe code is as follows:
//bubble sort (array sort)function Bubble_sort ($array) {
Copy the Code code as follows:
Get the current domain name:
echo $_server[' server_name '];
Get the source URL, that is, click to the previous page URL of this page
echo $_server["Http_referer"];
$_server[' Request_uri '];//gets the suffix of the
Htmlpurifier plug-in usage
Download Htmlpurifier Plugin
The useful part of the Htmlpurifier plugin is the library
using Htmlpurifier Library class librariesThe first wayCopy CodeThe code is as follows:
Require_once ' HTMLPurifier.auto.php
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