a simple procedural framework.
Webgame Program Composition:
Three parts.
The first is the data flow. The second is the procedure. The third is art.
Among them, the data flow includes the function. Data flow can only be reflected in the
First, define the array
You can use the array () language structure to create a new array. It accepts a number of comma-separated key = value parameter pairs.
Array ([key =>] value, ...)//key can be a number or string//value can be any value
Example
In my opinion, the class in PHP, the language used to express is informal language, and not sure whether it is correct.
Building a class is simple.
Copy CodeThe code is as follows:
Class my_class{}
?>
What exactly does a class do? A lot of
Copy CodeThe code is as follows:
Calculate ID Check code, according to national standard GB 11643-1999
function Idcard_verify_number ($idcard _base) {
if (strlen ($idcard _base)! =) {return false;}
Weighting factor
$factor = Array (7, 9, 10, 5, 8, 4,
Character interception to solve the Chinese interception problem
The code is as follows:
function cut_string ($string, $start, $sublen, $extstring = ' ... ', $code = ' UTF-8 ') {//cut_string start if ($code = = ' UTF-8 ') {$p A = "/[\x01-\x7f]|
Pie chart
Copy CodeThe code is as follows:
//+------------------------+
//| Pie3dfun. php//Common Functions |
//+------------------------+
Define ("Angle_step", 3); Defines the angle step when drawing an elliptical arc
Define ("font_used",
However, there is generally no coding problem in English, only the Chinese data will have this problem. For example, when you write a program with Zend Studio or editplus, using GBK encoding, if the data needs to enter the database, and the database
The whole process, so to speak, amazed more than surprises. And I feel the first time I was in Windows to configure PHP the kind of fragile ignorance feeling ...
First of all... For the first time, the PHP team separated out one of the Windows
Serialization of objects
Sometimes it is necessary to transfer an object over the network, in order to facilitate the transfer, the whole object can be converted into a binary string,
When you reach the other end and revert back to the original
1. If a method is static, make a static declaration of it. The rate can be increased to 4 times times.
2.echo is faster than print.
3. Use Echo's multiple parameters (meaning: a comma instead of a period) instead of a string connection.
4. Determine
This is a slightly more experienced phper that will solve the problem in the following way
1. Look at the error output, from the output item back to the source code, in the context of the source of debugging code can be the simplest
$debuglineno = __
Hi everyone free locomotive collector of friends:
The free version of the locomotive does not support external processing of collection results, such as using PHP to assist with the results, and the locomotive itself is not fully supported for
In the Friday, to do a PHP simultaneously to the MySQL database and SQL Server database connection Dongdong
I used to use MySQL to be not very familiar with SQL Server, so stones. No, at least MySQL and SQL Server are relatives.
When you make a
We usually declare a class first, then use this class to instantiate an Object!
However, when we declare this class, we want to use the properties or methods of this class within the class itself. What should be said?
For example:
I declare a user
After PHP5.0, PHP object-oriented commission more methods, make PHP more powerful!!
Some of the functions in PHP called Magic Methods, introduced here: in fact, in the general application, we need to use them!!
1.__construct () when an object is
To use a high version of PHP on IIS6, you must install the fastcgi extension,
Microsoft FastCGI Extension for IIS 5.1 and 6.0
Then let your IIS6 support the fastcgi.
Then set the CGI and fastcgi parameters in php.ini:
Fastcgi.impersonate = 1
fastcgi.
foreach is the operation of an array copy (by copying the arrays), while the while is manipulated by moving the internal indicators of the array, which is generally considered to be faster than foreach (because the foreach first copies the array in
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