1. Improve PHP's operational efficiency
One of the advantages of PHP is that the speed of the general Web application, can be said to be enough. However, if the site's access is high, with narrow or other factors causing the server performance
PHP header to define a PHP page for UTF encoding or GBK encoding
PHP page for UTF encoding
Header ("content-type:text/html; Charset=utf-8 ");
PHP page for GBK encoding
Header ("content-type:text/html; charset=gb2312 ");
PHP page for BIG5
Its advantages are:
1, you can define multiple separators at once. When a function is executed, it is cut by a single delimiter rather than by the entire separator, while the explode is cut by the entire separator string. Therefore, explode can be
1. Create a file (test.php)
My path is as follows
F:\Projects\PHPTest\test.php
2. Open the Apache configuration file with Notepad
D:\Program files\zend\apache2\conf\httpd.conf
Join on the last line
Alias/test "F:\Projects\PHPTest"
Write recursive functions, you can consider caching, define some static variables to save the results of the last run, the efficiency of multiple programs is very helpful. Approximate steps are as follows : step1: to database fetch data, put
This article illustrates how PHP simply uses PDO in the database abstraction layer. Share to everyone for your reference, specific as follows:
The test code is as follows:
exec (INSERT into T_user (name,email) VALUES ('. $_post[' name '). "', '
Php+ajax No Refresh Paging implementation code detailed, recently in the Ajax tutorial, want to write a simple introduction of the Php+ajax No refresh paging, we based on the AJAX development Framework, the code is as follows:
var
One, what is an array
An array is a set of data that organizes a series of data into an operable whole. Each entity of an array contains two items: The key and the value.
Ii. Declaration of data
There are two main ways to declare an array in
"Log errors to the system log"
In php.ini, set Error_log to:
Copy Code code as follows:
Error_log = syslog
or use the Ini_set () function setting at run time.
"Example 1"
To view the error log (Windows
I have a daily cut on the server nginx log habit, so for every day to visit the major search engines, can always record some 404 page information, traditionally I just occasionally analyze the log, but for a lot of log information friends, manual to
In the development of Web applications, people often use the session to store data. But some people may not know that in PHP, improper session usage may cause concurrency problems. Indian Medical Industry software solutions provider PLUS91
See this problem, the first reaction is namespace relationship, but I have never used SimpleXML operation namespace, so opened the manual to check the data, the problem is not resolved, and ultimately through Google to solve the problem.
Ask a
The following is an illustrated way to introduce PHP to implement a dynamic Web server, the details are as follows:
The server implemented in this paper is just a demonstration and understanding of the principles used, and strive to be easy to
1. Opening remarks
This disclosure is the result of the test results of the questions raised in the following Web pages:Http://code.google.com/p/pasc2at/wiki/SimplifiedChinese
Known 1.php exists, the results of the above script
Typically, users use a browser Web page form to submit data to the server post, and we use PHP to receive data from the user post to the server and to handle it appropriately. But in some cases, if the user uses the client software to send post data
You can use the following PHP function to verify that a card number is a credit card:
function Validatecard ($cardnumber)
{
$cardnumber = preg_replace ("/\d|\s/", "", $cardnumber); # Strip any non-digits
$cardlength = strlen
That's how it started.
$str = Iconv (' UTF-8 ', ' GB2312 ', unescape (isset ($_get[' str ')) "$_get[' str ']:");
After the launch of a heap of such a mistake: Iconv (): detected an illegal character in input string
Considering the GB2312 character
Need to turn on PHP PDO support, php5.1 above version support
To realize the single instantiation of database connection, there are three factors static variable, static instantiation method, private constructor dpdo.php
Class dpdo{private
The process of configuring PHP and MySQL is omitted, if under Ubuntu, refer to Ubuntu 10.04 installation Memo.
1. Basic grammar
The way to embed PHP scripts in HTML code is to write the code in . The Echo or print function is used to output data
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