The following gives the source code of the two versions of the function and the simple test, and finally I will give a more practical function of the string interception. It is important to note that the string interception problem discussed here is
Official Download Address:
MySQL http://www.mysql.com/downloads/mysql/find an MSI file down. Apache http://httpd.apache.org/download.cgi
PHP http://windows.php.net/download/#php-5.4
The first is MySQL, (this way, the Oracle acquisition of
Today to others to do the site when there is a need to have a domain name query function, check out a bit of information to write a simple query function
The front page uses a checkbox with the following code:
Copy CodeThe code is as follows:
The first type:
Copy CodeThe code is as follows:
? $str = "This is a test \ n";
$patten = Array ("\ n", "\ n", "\ R");
?//replace \ r \ n First, then presence \ n
$str =str_replace ($order, "", $str);
?>
PHP has three ways to solve
1. Use
I have seen the source of Phpcms, discuz, so there may be a lack of innovation, but the principle is mostly connected, but the details may be slightly different processing.
To get to the point, let's start with the concrete implementation process.
1.
1> if ("false") is equivalent to if (true), because a non-empty string is true
2> Check Data type:
Is_array ();
Is_object ();
Is_string ();
Is_null ();
Is_integer ();
3> PHP5 introduces the type hint (type hint) of a class to constrain the parameter
1. Universal Cache Technology:
Data cache: In this case, the data cache refers to the database query PHP cache mechanism, each time you visit the page, will first detect the corresponding cache data exists, if not exist, connect to the database,
1. Factory mode
The main function is to reduce the coupling degree.
Copy CodeThe code is as follows:
Abstract class operation{
Abstract public Function GetValue ($num 1, $num 2);
Public Function getAttr () {
return 1;
}
}
Class Add extends
Copy CodeThe code is as follows:
Class Crypt3des
{
Private $key = "";
Private $iv = "";
/**
* Construct, pass two key and IV that have been base64_encode
*
* @param string $key
* @param string $iv
*/
function __construct ($key, $iv)
{
if (Empty
There are three types of access modifiers in PHP, namely:
Public (common, default)
Protected (Protected)
Private (privately)
They can be used, respectively, on the properties and methods of a class (the properties and methods of a class are
PHP Super Global Variables list$_get[] Get an array of variables submitted with the Get method
$_post[] Get an array of variables submitted with the POST method
$_cookie[] Get and set the COOKIE ID of the current Web site
$_session[] A unique
Is_numeric: Detects if it is a numeric string and can be negative and fractional
Ctype_digit: Detects if characters in a string are numbers, negative numbers and decimals are detected without
Note that the parameter must be a string, and if it is
For those of us who want to do web security, it is better to learn, but all things catch the root, we want not fish but fishing. In the country, a variety of PHP Programs 1.0 version, 2.0 version like springing up, but, everyone is concerned about
A brief description of the relevant knowledge is given in the PHP manual:
1. Connection handling:
Inside PHP, the system maintains a connection state with three possible conditions:
0-normal (Normal)
1-aborted (Abnormal exit)
2-timeout (Timeout)
I will share this out, if later who need to be able to download the following plugin directly
How to use:
In Cnblogs Select Backup data, export an XML to local;
Download the plugin in the attachment, install to the \wp-content\plugins directory;
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