First, the core points of thinking:
1. What global variables are outdated and how to handle them?such as: unset ($GLOBALS, $_env, $HTTP _get_vars, $HTTP _post_vars, $HTTP _cookie_vars, $HTTP _server_vars, $HTTP _env_vars);2. What global variables
PHP header to define a PHP page for UTF encoding or GBK encoding
PHP page for UTF encodingHeader ("content-type:text/html; Charset=utf-8 ");
PHP page for GBK encodingHeader ("content-type:text/html; charset=gb2312 ");
PHP page for BIG5
Using php5.3 or above we can use PDO and mysqli to process data directly
1. Use PDO (PHP Data Objects)
The code is as follows
Copy Code
$stmt = $pdo->prepare (' SELECT * FROM employees WHERE name =: Name
The most common applications are in user login and some API data exchange scenarios.The author contains some of the more classic PHP encryption and decryption function code, to share with you. Encryption and decryption principle is generally through
The session is mainly divided into two parts:
One is the session data, which is stored by default under the server's TMP file and is in the form of a file.
Another is marked session data session Id,session ID, is that session file file name,
The number of rows affected by an update operation in MYSQLI can be returned in two ways:
1. Returns the number of rows matched
2. Returns the number of rows affected
By default, the value returned by Mysqli_affected_rows is the number of rows
By default mysqli is not open in PHP and we need toTo use mysqli extensions in PHP, you need to add the following settings to the configuration file php.ini:
The code is as follows
Copy Code
Extension=php_mysqli.dll
Overview: The network Silver payment interface and Alipay interface is roughly the same, the main difference is that the bank of communications to provide the core of the interface, such as encryption, such as through the Java implementation. So, to
Introduction: This is the introduction of PHP and file operations related to the system functions, these functions are also very important, the following tianya is still more commonly used for detailed illustrations.
basename-returns the file name
Str_replace for string substitution
The code is as follows
Copy Code
Str_replace ("PHP", "java", "PHP Tutorial 4");Java Tutorial 4?>
The variable being searched is a string
The code is as follows
The original is based on the user input of the digital judgment and then converted to the desired capital number, if we first put the case of an array, and then judge the conversion is OK.$data = $_post[' RMB '];if (!ereg ("^[0-9.]", $data)) Die ('
The first file name is Phplist.inc
The code is as follows
Copy Code
?Global $htmlroot;$htmlroot = "/web/html"; "/web/html" is the Apache document root directory that users can modify according to their own configuration?>
Double quotes will let the program be checked for variables that are not
When you use a variable, you can compile it with double quotes before you can replace it with a variable value.
There are also n and so to be double quotes, with single
You can use XML-RPC to allow different platform software to interact with each other, we assume that using PHP as the foreground (client), Python as a service backstage, between XML-RPC invoke the services provided by Python. Examples are as follows:
ZF-developed methods for integrating PHP applications with traditional PHP applications
As you know, ZF needs to have all HTTP requests processed by index.php (bootstrap), so we need to configure the URL rewrite rules for the server, such as
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