Project Structure:
Operation effect;
conn.phpCopy CodeThe code is as follows:
Class connectionmysql{HostPrivate $host = "localhost";Username of the databasePrivate $name = "root";Password of the databasePrivate $pass = "";Database namePrivate
First, we start by quoting some concepts:
Factory mode: specifically defines a class to be responsible for creating instances of other classes, and the instances that are created typically have their same parent class. The factory pattern belongs to
Two methods and differences of PHP array merging
If it is an associative array, the following:
Copy CodeThe code is as follows:
$a = Array (
' WHERE ' = ' uid=1 ',
' Order ' = ' uid ',
);
$b = Array (
' WHERE ' = ' uid=2 ',
' Order ' = ' uid desc ',
1. Single-Quote burst path
Description
Add single quotation marks directly after the URL, requiring that the single quotation mark is not filtered (Gpc=off) and the server returns an error message by default.
Eg:
www.xxx.com/news.php?id=149′
2
Now let's take a look at the specific ways to use
GetType ()
GetType returns the following values based on the parameter type
"Boolean" (from PHP 4)
"Integer"
"Double" (If float returns "Double" instead of
For example:
Copy CodeThe code is as follows:
$a = 1;
Include ' B.inc ';
?>
Here the variable $a will take effect in the include file B.inc. However, in a user-defined function, a local function scope is introduced. Any variables used inside the
Read this PHP file_exists and is_file,is_dir The difference between the basic understanding, PHP file_exists = Is_dir + is_file.
Write the program to verify:
Execute 1000 times and record the time required.
File exists (current directory)
Is_file:
It is obvious that file_exists is affected by the ASP, because the ASP not only has fileexists and folderexists,driverexists, so what is the meaning of file_exists in PHP?
PHP file_exists = is_dir + is_file
It can determine whether a file exists,
First, bubble Sort methodDescription: Find the maximum number, arrange it to the last face, and then continue looking for
Cases:
Copy CodeThe code is as follows:
$arr = Array (3,5,-1,0,2);
for ($i =0; $i
for ($j =0; $j
if ($arr [$j]> $arr
Three main features of face-to-direction: encapsulation, inheritance, polymorphism first, simply understand the abstraction:
When we define a class in front of us, we actually extract the properties and behaviors common to a kind of things, and form
Display_errorsError echo, common term development mode, but many applications in the formal environment also forgot to turn off this option. Error echo can expose a lot of sensitive information to facilitate attackers ' next attack. It is
UUID (Universally unique Identifier), GUIDs are expected to generate a unique identification code throughout the space-time range, which is necessary in a distributed computing environment. However, if you just want to create a "local unique
In fact, we can use the Array_filter function to easily remove the multidimensional null value, and the array subscript has not changed, the following is an example of usage:
$array = Array (
0 = ' brother Kingboard ',
1 = False,
2 = 1,
3 = NULL,
4
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
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