This article is divided into three parts for everyone to introduce, the specific content as follows
1. User, server and background server interaction
Example: The user sends a text message to the public, the message is first passed to the server,
The example of this paper describes the addition and deletion of yii to add rows and modify operations. Share to everyone for your reference, as follows:
:
Controller:
db; Determine if there is a deletion of the IDs if (Yii:: $app->request->
if (eregi ("^[_.0-9a-z-]+@" ([0-9a-z][0-9a-z-]+.) +[a-z]$ ", $email)) {
echo "Your e-mail through a preliminary check";
}
?>
In this sentence, the first is the application of a eregi function, this function is good understanding. If you look for a
PHP filters contain two types of
Validation: Used to verify that a validation entry is valid
Sanitization: Used to format the validated item, so it may modify the value of the validation entry, remove the illegal character, and so on.
Input_filters_
This paper describes the method of the YII framework to prevent SQL injection, XSS attack and CSRF attack. Share to everyone for your reference, as follows:
The methods commonly used in PHP are:
/* Anti-SQL injection, XSS attack (1) */function
For example, I have 0.10456, to become 10.5%?
Round
(PHP 3, PHP 4)
Round--Rounding a floating-point number
Description
Float round (float val [, int precision])
Returns the result of rounding Val based on the specified precision precision (number
As you know, PHP is a PHP is a server-based to create dynamic scripting language, you can use PHP and HTML to generate the home page. When the user opens the PHP page, the server executes the PHP command and sends the results to the user's browser,
PHP's conversion of Chinese characters has always been a rather troublesome thing.
The class contains four filters "[dec];", "& #x [hex];", "%u[hex]", "UTF8 conversion"User-friendly and customizable filtering for your favorite
How to define an array: There are two main ways to create an array in PHP, let's look at how to create an array
(1) Create an array of methods that assign values directly to each element.
The format is: $arrayname [Key]=value;
Where Arrayname is
PHP has a very simple garbage collector that actually garbage collects objects that are no longer in the memory scope (scope). The internal way of garbage collection is to use a reference counter, so when the counter reaches 0 o'clock (meaning that
At this point, the is_scalar built-in function comes in handy.
Is_scalar--detects if a variable is a scalar
Scalar variables are variables that contain an integer, float, String, or Boolean, while array, object, and resource are not scalars.
In Running a PHP program, you will typically encounter the "Fatal error:allowed memory size of xxxxxx bytes exhausted" error, which means that the PHP script uses too much memory and exceeds the maximum allowable memory set by the system.
To solve
The time in PHP has 2 formatting functions: Date () and Gmdate (), which are described in the official documentation:
Date--Formatting a local time/date
Gmdate--Formats a GMT/UTC date/time and returns Greenwich Mean Time (GMT).
For example, we
A. Internal sorting (directly loaded into memory for sorting): Includes Exchange sort (bubbling and fast method), select Sort, insert sort
B. External sorting (due to large amount of data, need to sort with external storage): Includes merge sort,
The Web server executes a PHP script, which sometimes takes a long time to return to the execution results, and the subsequent script waits for a long period to continue. If you want to implement the next step simply by triggering the execution of
As is known to all, Git is now a leader in distributed versioning, creating a complete ecosystem around git. Learning Git is, of course, the basic workflow of learning git. Compared to traditional version control systems like SVN, Git is a powerful
First, static variables
1. A static variable is a variable that exists only in scope, but the value of the variable is not lost after the function is executed, that is, the variable will still remember the original value the next time the function
Create cascading menus with YII framework dropdown
You often need a form, cascading city, or cascading classification and so on, with two drop-down boxes, one of which depends on another drop-down box. Using the built-in Ajax features of Yii, you
At present, the Web site development based on PHP has become the mainstream of the current website development, the author focuses on the PHP website attack and security precautions to explore, aimed at reducing the vulnerability of the website, I
The usage of the three functions for PHP (), Isset () and Is_null () has been discussed a lot, and a lot of data may not be clear. Here again, but not from the concept, the direct use of program examples to speak, it should be more profound 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