A. String Insertion
The difference between a double quote and a single quote:1. Use of double quotes:
"; $username = "small East"; If the exclamation point in English will parse the variable normally, echo "His name is $username!"; /His name is
Basic functions of array manipulation
The key name and value of the array
Array_values ($arr); Get the value of an array
Array_keys ($arr); Gets the key name of the array
Array_flip ($arr); the values in the array are exchanged with the key names
Traversing an array is the most common thing in programming, and here's a discussion of the for and foreach two methods. There are too many scenarios for traversing in these two ways, and here we are only discussing the following two arrays as an
1. Add a new Process page:
Select the process node: query ($suser); foreach ($auser as $v) { echo " {$v [2]} ";}? >strquery ($sname); echo "{$k}--{$name}-- ';}? > Please enter the process name:
2. Add a new process (and other) processing
Continue
The Continue is used in the loop structure to skip the remaining code in this loop and start the next loop.
Note: Notice that the switch statement is considered a looping structure for continue purposes in the PHP tutorial.
Continue
PHP Control statements
1. If statement
An If statement is an important feature in most languages, and it executes program segments based on conditions. The IF statement in PHP is similar to C:
if (expr)
Statement
As discussed in the expression, expr
any PHP script is composed of a series of statements. A statement can be an assignment statement, a function call, a loop, a conditional statement, or even a statement that does nothing (an empty statement). The statement usually ends with a
The function of the ternary operator is consistent with the "if...else" process statement, which is written in a single line, the code is very concise, and the execution is more efficient.
Using the ternary operator properly in a PHP program can
The planning tasks used by the company are all about this:
*/2 * * * * root cd/opt/xxxx/test_s1/html/xxxx/admin; PHP index.php Task Testone >/dev/null 2>&1*/2 * * * * root cd/opt/xxxx/test_s1/html/xxxx/admin; PHP index.php task Testtwo >/dev/null 2>
There are many operators in the PHP programming language to help us deal with related characters and arrays, and in some cases PHP converts class numeric data, such as strings containing numbers, to numeric processing, and the = = operator is one of
"(focus) four ways to iterate through an array"
1. Iterating through the array with A For loop
Conut ($arr); Used to count the number of array elements.
the For loop can only be used for traversal, pure indexed arrays!!!!
If there is an
The development of the system has a large number of empty connections to the sleep state of the database, at the same time through the log Discovery system through the PHP Curl request the third-party API interface Feedback a large number of
The foreach and while loops in PHP, so what's the difference between the foreach and while loops, and that performance is better, let me show you the foreach and while loop differences and performance comparisons.
In the while loop, Perl reads a
When a string is taken as a numeric value, the result and type are as follows:
If the string does not contain '. ', ' e ' or ' e ' and its numeric value is within the range of the integral type (as defined by Php_int_max), the string will be
the loop structure in PHP is roughlyFor loop
,While loop
, a do{} while loop and several foreach loops, regardless of the loop,
There are several ways to jump out of a loop in PHP:
Code:
'; } $i + +;} Exit;echo ' here does not output ';?
I. Classification of Operators
1, by Operation number classification
1.!true//Unary operators2. $a + $b//two-dollar operator3.true? 1:0//ternary operator
2, according to the function classification
(1) Arithmetic operators1.+ 、-、 x,/,% (take more)
(
Today I found a small usage of the PHP ternary operator . It gives me a little fun with the dry brain!
The PHP ternary operator is a concise primary use when assigning values to a parameter. A major usage: the PHP ternary operator allows you to
An operator is a symbol that tells the compiler to perform a particular arithmetic or logical operation, and usually forms an expression along with the operand, which we often see as participating in mathematical operations or logical operations.
Bitwise operators allow you to evaluate and manipulate the bits specified in the integer number.
The bitwise operators in PHP are the following table
Example
name
Results
$a & $b
and (Bitwise AND)
Set
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