Very good PHP coding specifications. note: This shows the coding specifications from the PHPCMS development documentation. Although the code is called the PHPCMS development specification, I think this applies to all PHP programming. After writing
: This article mainly introduces the basic syntax of [php] and the value transfer between pages. if you are interested in the PHP Tutorial, refer to it. Let's talk about the previous example ~
I. basic objectives
Set a form in phpsend.html. The
Filter input
Filtering is the foundation of Web application security. It is the process of verifying the legitimacy of your data. By confirming that all data is filtered at input, you can avoid contaminated (unfiltered) data being into trusting and
What this section explains
Sequential Process Control
Single Branch
Dual Branch
Multi-Branch
Switch
For
While
Do...while
Break
Continue
Goto
Objective
PHP's Process control and other languages are very
Break
(PHP 4, PHP 5)
Break ends the execution of the current for,foreach,while,do-while or switch structure.
Break can accept an optional numeric parameter to decide to jump out of a few loops.
\n"; } /* Use optional parameter */ $i = 0;
Just the last example to explain it to you ~
I. BASIC OBJECTIVES
Set a form in phpsend.html, the value entered above can be phpget.php to receive
Second, the production process
Like JavaScript, the values in PHP are of a type, and a $ represents a
Do is a multi-conditional judgment of the small thing, in order to structure clear, easy to expand, want to use if else, each other with Goto jump into the next condition, each piece of code has been tested normal, such as the following directly in
1. Loop control Break statement:
Break ends the execution of the current for,while,do-while or switch structure.
Break can accept an optional numeric parameter to decide to jump out of a few loops.
'; break;case 10:echo ' quit at 10 '; Break 2 ;
The following small series will bring you a simple example code of phpMVC message book (mandatory ). I think this is quite good. now I will share it with you and give you a reference. Let's take a look at the following small series to bring you a
This is a creation in
Article, where the information may have evolved or changed.
go language in the process, added a
Fallthrough
key word.
1. Conditional Statements
Conditional statements do not need parentheses to enclose conditions
This is a creation in
Article, where the information may have evolved or changed.
5.0 Control Structure
This chapter is very simple, the program can not be separated from the control and loop statements, according to the requirements of each
$a=5;switch($a){ case 6: echo "\$a is 6"; case 5: echo "\$a is 5"; case 4: echo "\$a is 4";}
As in the above example, my understanding is that each time $ A is compared to the value of the case, the output statement is the same, and the
------Java Training, Android training, iOS training,. NET training, look forward to communicating with you! -------1.while Cyclewhile (condition)//Perform one judgement at a time{Loop body}Operating principle:1. If the initial condition is not
PHP: Hypertext Preprocessor
PHP is a server-side scripting language;
PHP scripts are executed on the server;
--------------------------------------------------------------------------------------------------------------- -----------
PHP files can
Php reports syntaxerror, unexpectedT_GOTO, and expectingT_STRING errors. the error file and number of lines point to the following code. why? The php version of this machine is 5.3.8, Apache/2.2.21. I guess it is an environment problem because it
PHP file format
For files containing only PHP code, the end flag ("?>") is not allowed, PHP itself does not need ("?>"), so that it can prevent the end of it is accidentally injected corresponding.
Important: The contents of any binary code
If switch do and while and forWhen do these statements work?1), when judging the fixed number of values, you can use if, you can also use switch. However, it is recommended to use switch for relatively high efficiency.Switch (variable) {Case value:
PHP: Hypertext Preprocessor (Hypertext preprocessing language), server-side script.
1. the start and end tags have two common php tags:
And
2. Notes: similar to General languages
3. Data Type:
Four scalar types: boolean, integer, float (also
State machine-based game frameworkA finite state machine is a finite state machine,And can be changed from one State to another according to the corresponding operation,The agent can only be in one state at a time.English: Finite State
Ifif () { statement;} else if { statement;} elseif { statement;} else { statement;}else ifelseifis a little different from the meaning of syntactic analysis, but the bottom line is that they produce exactly the same behavior.Cyclewhile ()
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.