PHP often handles arrays of unknown depths, which are generally handled recursively, but are well known for the depth of the array.
Get array Length:
The code is as follows
Copy Code
/*** @description Get array length* @
Traverse the current directory and subdirectories. Encode all file translations into UTF-8
The code is as follows
Copy Code
PHP iconv.phpexec it on root dir$path = DirName (__file__);Tree ($path);function Encodefiles
CC Attack Reason
The principle of the CC attack is that the attacker controls some hosts to keep sending a large number of packets to the other server, causing the server to run out of resources until downtime crashes. CC is primarily used to
The first way
$data = eval (' Return '. Iconv (' GBK ', ' Utf-8′,var_export ($data, True) ').Here the Var_export function can output or return a string representation of a variable. This function returns the structure information about the variable
In all the needs of the script, we will calculate the second part of the first to generate the chart variable. And then we prepared the
The main image, the actual output data. The result of each type is a selection from the database tutorial, the
PHP Security Filtering and Example tutorialPHP filters are an extension of PHP that helps you to easily and reliably validate strings and variables so that you will never be afraid of the following statements:
Include ($_get[' filename ')]
?>
Example One
The page's paging selection effect directly affects the user experience. There are a number of ways to do something like this, and the main advantage I write here is that the front and back ends are separated, and you can define the
When the content of the article, in order to facilitate reading and page display we generally will content pagination to display. Generally, paging is a static file that generates multiple pagination after a post is published in the background. In
Let's build the injection statement.Enter in input boxa% and 1=2 Union select 1,username,3,4,5,6,7,8, password,10,11 fromalphaauthor# into the SQL statement.
SELECT * from alphadb where the title like%a% and 1=2 Union Select1,username,3,4,5,6,7,8,
Misuse of include 1. The reason of the loophole: Include is the most commonly used function in writing PHP Web sites, and supports relative paths. There are many PHP scripts that directly take an input variable as an include parameter, resulting in
One of the limitations we can't ignore when we submit a form is to prevent users from repeatedly submitting the form, because it's possible that the user clicks the Submit button consecutively or that the attacker maliciously submits the data, so we
This section describes some common regular expressions, such as regular expression verification of date, number, phone number, and time format.Regular Expression Matching Chinese characters: [u4e00-u9fa5]Note: matching Chinese characters is really a
Php Tutorial user registration filters Chinese user names. In many development scenarios, Chinese names are not allowed, so we create an example today to restrict Chinese name registration, in php, we can use regular expressions to restrict Chinese
Definition and usageError_reporting () sets the php error level and returns the current level.SyntaxError_reporting (report_level) if the level parameter is not specified, the current error level will be returned. The following items are possible
In php, urlencode and rawurlencode are encoded in Chinese.String urlencode (string str)Returns a string. All non-alphanumeric characters except-_. In this string will be replaced with a semicolon (%) followed by two hexadecimal numbers. This
/*** Get the current server date and time*/ The code is as follows:Copy code Function get_server_datetime () {Date_default_timezone_set ("asia/chongqing ");Return date ("y-m-d h: I: s "); } /*** Get the current server date*/ The code is as
$ Days = date ("y-m-d ");// Method 1 positive verification date The code is as follows:Copy code $ Reg = "/d {4}-d {2}-d {2 }/";Preg_match ($ reg, $ days, $ arr );Print_r ($ arr ); // Method 2 use cehckdate for verification The code is 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