When it comes to security issues, be aware that you need to ensure that you write secure applications in addition to the actual platform and operating system security issues. When writing a PHP application, apply the following seven habits to ensure
Definition and usageThe Htmlspecialchars () function converts some pre-defined characters to HTML entities.
The predefined characters are:& (No.) becomes &• "(double quotes) become"• ' (single quote) become '> (greater than) becomes
Fsockopen function can be used, first of all to open the php.ini in the Allow_url_open=on;
Fsockopen is the encapsulation of the socket client code, which encapsulates the socket_create,socket_connect.
Server-side code: server.php
Copy CodeThe code
Here are two good tools to use for PHP capture. One is Snoopy, one is simple_html_dom. There are many ways to collect (in fact, the essence of 2-3 kinds, the other is derived), PHP comes with a few methods can also be directly collected. But, out of
If the use of the form submitted, will not appear garbled, and the use of Ajax submissions will appear garbled, what is the reason?
My understanding is, I write the source code, the general use Notepad to write, save when the default ANSI code, the
Constants can be understood as variables with constant values. When a constant value is defined, it cannot be changed anywhere else in the script. A constant consists of an English letter, an underscore, and a number, but the number cannot appear as
Command mode:Encapsulates a request as an object so that you can parameterize the customer with different requests, queue requests or log requests, and support revocable operations.
Command class:1. Command role: declares an abstract interface to
We tend to optimize caching settings on the server, but we seldom notice
client-Side Caching, which is exactly the caching mechanism of the browser.
In fact, each browser has a cache policy, will temporarily cache each of the files viewed in a
settype-Setting the type of a variable
BOOL Settype (mixed $var, string $type)Set the type of the variable var to type.
The possible values for type are:
• "Boolean" (or "bool", starting from PHP 4.2.0)• "Integer" (or "int", starting from PHP 4.2.0)
des is a standard data encryption algorithm, the detailed introduction of this algorithm can refer to the wiki and Baidu Encyclopedia:
Wiki Encyclopedia Baidu Encyclopedia
PHP has an extension to support DES encryption algorithm, is:
We're going to make an unlimited assortment of goods.
First, the database fields are:ID----------Commodity primary Key ID
FID----------Product Parent ID
Name----------Product Name
the final output of the array format is
Copy CodeThe code is as
1. DOM functions
A, Domdocument->load ()Role: Loading an XML fileUsage: domdocument->load (string filename)Parameters: Filename,xml file;Returns: TRUE if successful, or FALSE if unsuccessful.
B, Domdocument->loadxml ()Role: Loading XML codeUsage:
One,
Zoning Concepts
partitioning allows multiple parts of a single table to be allocated across the file system according to the specified rules. Different parts of the table are stored as separate tables in different locations. MySQL supports
1. Calling syntaxUse the function date () implementation to get the current time format, for example:
2. Time format parameter settingIn the above syntax "y-m-d h:i:s", the format shown is: year-month-day hours: minutes: secondsSo we can replace
The Boolean type is the simplest type in PHP. It can have a value of TRUE or FALSE.
Such as:
$foo =false;$foo 1=true;echo "is false when the output value is:". $foo; No output valueecho "True when the output value is: ". $foo 1; Output 1
Here are
The first of these methods
Copy CodeThe code is as follows:
$FileID =date ("Ymd-his"). '-' . Rand (100,999);
$FileID a random number such as 20100903-132121-908.
?>
The second method of
Copy CodeThe code is as follows:
function Randomkeys
PHP is not suitable for a resident shell process in many cases, he does not have a dedicated GC routine, and does not have an effective memory management approach. So if you are using PHP as a resident shell, you will often be unhappy by memory
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