Recently, I have seen a clever method. The principle is:
$ Var_a = 'var _ B ';
$ Var_a = 'test ';
Echo $ var_ B; Is 'test'
So we can handle it like this
CopyCodeThe Code is as follows: foreach (Array ('_ cookies',' _ Post', '_ get') as $ _
Introduction:Blitz templates is a fast PHP template engine developed in C language. It serves as a PHP Extension function. It started to replace as a php_templates but grew to more work. It is based on scalable template controllers (custom view
CopyCode The Code is as follows: function getip (){
$ IP = getenv ('remote _ ADDR ');
$ IP _ = getenv ('HTTP _ x_forwarded_for ');
If ($ IP _! = "") & ($ IP _! = "Unknown") $ IP = $ IP _;
Return $ IP;
}
copy Code the code is as follows:
This is one collected a long time ago. I don't know who wrote it, but there is no problem after testing ~
Javascript
Code
Copy code Code: function phpunescape ($ escstr)
{
Preg_match_all ("/% u [0-9a-za-z] {4} | %. {2} | [0-9a-za-z. +-_] +/", $
Rule 1: Never trust external data or input
About Web ApplicationsProgramSecurity: The first thing we must realize is that we should not trust external data. External data includesCodeAny data directly entered in. Before taking measures to
Task 2: identify the scope of the Variable
⚑Local variables and global variables
The existence of a variable has its life cycle. We can make it exist in a small function or the whole function.Program. Variables declared in general are called
Variable definition
⚑Variable type
⚑Use of Variables
Variables are objects that can be constantly changed in the memory. we can think of the memory as a sub-district. There are many tenants in the street, and each household has its own house number,
Merging arrays has three functions:
1. array_combine ()
It carries two parameter arrays. The value of parameter array 1 serves as the key of the new array, and the value of parameter array 2 serves as the value of the new array. Very simple.
In this section, we will look at how to create a class and object in PHP.
1. Create a class
In PHP, the creation of a class is basically similar to that in C #/Java. Let's take a look at the simplest example:CopyCodeThe Code is as follows:
Date -- format a local time/date
Gmdate -- format a gmt/UTC date/time and return the Greenwich Mean Time (GMT ).
For example, if the current time zone is + 8, the time returned by the server running the following script should be as follows:
A simple exampleThere is an existing student information database, and multiple records need to be deleted at one timeCreate a file named Del. phpCodeAs follows:
Copy code The Code is as follows:
Student Information table
Option Student ID
Annotation symbol:
// Single line Annotation/**/Multi-line Annotation
Use of quotation marks
''Single quotes, no meaning, can be taken without any processing;"" Double quotes, PHP dynamic processing and
1. Create a file (test. php)
My path is as follows:
F: \ projects \ phptest \ test. php
2. Use notepad to open the Apache configuration file
D: \ Program Files \ Zend \ apache2 \ conf \ httpd. conf
Add in the last line
Alias/test
Below
Code (CODE) implements the function of containing different files according to the file name in the browser address bar parameters.
Copy code The Code is as follows: $ File_name = $ _ Get ["FILENAME"]; // obtain the current file name
Include
First look
File interface before creation
After the configuration file is created, the system prompts that the installation cannot be repeated.
NextCodeRight, the code on the HTML interface will not be available. Just go to the PHP
Readystate = status (0, 1, 2, 3, 4)
0: the request has not been initialized and open has not been called.
1: The request has been created, but has not been sent yet.
2: The request has been sent and is being processed
3: The request is being
The final effect is as follows:
Step. Inc. php:
CopyCode The Code is as follows :/**
* Step. Inc. PHP installation steps effect class *
* Extract the main code from the installation results of the comsenz data table for your learning.
* @
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