In the previous article, I used cookies and discuz databases to retrieve user names, user groups, user IDs, and other information, but that information is not necessarily accurate, because the auth value in the COOKIE is used for dynamic login
Php learning loop structure implementation code. For more information, see.
The code is as follows:
/* Loop structure* 1. while loop* While (expression)*{* Loop body; // execute repeatedly until the expression is false.*}* 2. do-while loop* 3.
There is no limit on function nesting in PHP. if there is a limit, it is also a limit on memory. This is because function nesting in PHP is implemented in the form of stacks. Each function is allocated with a memory segment to store partial content
Common P4 servers generally support up to 0.1 million independent IP addresses per day. if the access traffic is larger than this, you must first configure a dedicated server with higher performance to solve the problem, check whether the server
Defines the algorithm skeleton in an operation, and delays some steps to the subclass, so that the subclass can not change the structure of an algorithm, but define some specific steps of the algorithm inheritance relationship due to its own defects,
Converts an interface of a class to another interface that the customer wants. classes that are originally incompatible and cannot work together can work together.
The code is as follows:
/*** Adapter mode** Convert an interface of a class to
In recent projects, to solve the timeout problem in big data query, you need to split big data into small data and then perform cyclic processing. I have insufficient experience and limited technology. I can only use ajax to transmit data. The use
Compare multiple cycles and move the maximum number to the top of each comparison. During each loop, find the maximum value in the remaining variables and then reduce the query range. After multiple loops, the array is sorted.
The code is as
10 advanced PHP skills to improve php efficiency.
1. use an SQL injection memo formThe basic principle is never to trust the data submitted by users.
Another rule is to escape the data when you send or store it ).
It can be summarized as: filter
When we want to strictly limit the file type, we can simply use $ _ FILES [myFile] [type] to obtain the MIME type of the file and then check whether it is a valid type.
File suffix and MIME type detectionWhen we want to strictly limit the file type,
After executing the update statement, insert statement, or delete statement in php + mysql, you must determine whether the data has been updated. For more information, see. First of all, I suggest you navigate through the problem. The php Manual is
The numeric amount is converted to the Chinese capital amount function StringInt $ num the lowercase number to be converted or the lowercase string
The code is as follows:
/*** Function for converting a numeric amount to a Chinese capital amount*
Now everyone has countless accounts and passwords, which cannot be remembered. The principle is to complete authentication through the mail server pop service, or use SMTP, the addition of SSL has enhanced security. now everyone has countless
In order to remember the whereabouts of Baidu spider, I wrote the following PHP functions: one is to judge the spider name, the other is to remember the spider to the file, you can take a look
The code is as follows:
Function write_naps_bot (){$
Using the serialize () function and unserialize () function, the usage of these two functions is really out of the box. one is for serialization storage, and the other is for serialization recovery, which is very convenient today, I am doing
The short php code implements DOS attacks. sometimes you can use this code as an attacker without obtaining server permissions. Therefore, you must pay attention to the website security index. php.
The code is as follows:
$ Ip = $ _ SERVER
The number_format () function uses a thousand-bit grouping to format numbers. the number_format () function uses a thousand-bit grouping to format numbers.
Syntax
Number_format (number, decimals, decimalpoint, separator)
Parameters
The PHP version of the website cache to speed up the opening of the way to share, the need for friends can refer to the following instructions:
1. the compressed files are cached on the server, and the re-access reduces the re-compression time to
Some experience in PHP
Author: snowai
Recently, projects in the hands are relatively idle. Come here and share some accumulated skills with you!1. PHP redirectionMethod 1: header ("Location: index. php ");Method 2: echo "script
The installation guide for the new mysql + apache + phpLinux version has just been installed.
It's just today that the company's website has a new server. It took me one morning to install mysql + php + apache.
The old version of the new version
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