In PHP, arrays are divided into two types: Numerical index arrays and associated arrays.
The numeric index array is the same as the array in C language. The subscript is 0, 1, 2...
The subscript of the correlated array may be of any type, which is
In the past two days, we need to implement the following functions:
When a certain condition is reached, the server sends a text message to the user. The number of messages is multiple.
Basic Idea: scheduled Linux scanning. If a user meets the
1. the MySQL database is not correctly installed, and MySQL-related services are not started in the System Service (please check the correct method for installing MySQL)
2. libmcrypt is missing in the System32 (c: \ windows \ system32) Directory
This article focuses on the Windows PHP environment, and the Linux system is not in the scope of discussion.
For security reasons, the server does not allow PHP or other languages to execute the EXEC command. When you have special requirements
Nl2br (); // \ n
Addslashes (); stripslashes (); // escape special characters when operating on the database
Chop (); // remove the right space of the stringTrim (); // remove all spaces in the stringLtrim (); // remove the left space of the
Arrays in PHP are actually an ordered ing. Ing isValuesAssociatedKeys. This type has been optimized in many aspects, so it can be considered as a real array, or a list (vector), a hash list (an implementation of ing), a dictionary, a set, stack,
A string in PHP can be defined in the following four methods:
Single quotes
Double quotation marks
Heredoc syntax structure
Nowdoc syntax structure (since PHP 5.3.0 and later)
Single quotes
The simplest way to define a string is to enclose it
PHP supports eight basic data types.
Four scalar types:
Boolean (boolean)
Integer)
Float (float, also called double)
String (string)
Two composite types:
Array)
Object)
There are two special types:
Resource)
NULL)
BOoleanData Type:
The
Although this feature is very easy to program using PHP, it also has an important drawback: When you need to test the type of a variable, the language with loose processing types is confusing. Fortunately, PHP developers noticed this situation and
PHP compresses html webpage code (clear spaces, line breaks, tabs, comment tags ).
There is a good way to compress HTML. Compression of html is actually: clear line breaks, clear tabs, and remove comment marks. The role it plays cannot be
Scheduled tasks
Copy codeThe Code is as follows: ignore_user_abort (); // The user closes the browser and continues to execute
Set_time_limit (0); // no restriction on the running time
$ Interval = 3; // The interval between program loops in
Copy codeThe Code is as follows: $ str = '123456789abcdefg of the People's Republic of China ';
Echo preg_match ("/^ [u4e00-u9fa5_a-zA-Z0-9] {3, 15} $", $ strName );
Run the above Code to see the prompt information?
Warning: preg_match ():
Use cookies to save logon information on the page
1. Database Connection configuration page: connectvars. phpCopy codeThe Code is as follows: // Database locationDefine ('db _ host', 'localhost ');// User NameDefine ('db _ user', 'root ');//
Introduction
Php5.1. * And php5.2. * are found to be different during Database Pre-compiled code execution.
Advantages of pre-Compilation
1. Use placeholders to avoid entering data in SQL words. Automatically handle escape of characters such as
Introduction
The modifier mode dynamically attaches the responsibility to the object. To expand the functionality, the decorator provides an alternative solution that is more flexible than inheritance.
Mind Map
There is such a project as a
The explode () function separates strings into arrays.
Syntax
Explode (separator, string, limit)
Parameters
Description
Separator
Required. Specifies where to split the string.
String
Required. The string to be
Phpinfo ()
Function Description: outputs information about the PHP environment, related modules, and WEB environment.
Hazard level: Medium
Passthru ()Function Description: allows execution of an external program and echo output, similar to exec
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