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
This JS code is written by others, may not be the best, but I personally feel that the first to help others solve functional problems is particularly good. I made a few changes to use on my own project, here to share. Backstage with the tinkphp
Sometimes variable names can be a great convenience for programming. This means that variable names can be dynamically named and used. The usual variables are named by the following statements:
A mutable variable name refers to the use of a
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
Long time no environment, this is a smooth.
Let's review how the site works.
OK, to get to the point, this build environment Wamp version as follows:
Apache24:httpd-2.4.26-x64-vc11Php:php-5.6.30-win32-vc11-x64mysql:mysql-installer-community-5.5.56
Introduction
Normally our foreach can print each key in a one-dimensional array in order and value, but if it is a multidimensional array it needs to be looped in a nested loop, or recursively, but these are not flexible enough because, in the
The global keyword is used to access globals within a function.
Sample code
PHP stores all global variables in an array named $globals[index], index holds the name of the variable, the array can be accessed inside the function, or the global
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
Global is a special command in PHP, you call him a super global variable, let me introduce today I am using global to define the overall learning notes
is not accustomed to the variable scope in PHP, PHP function variables and the global is
What is the usage of process management?
First, to have the contents of the database
There will be a table, the first is the user table, and then is the process table, the user-written process table, as well as the auditor's table
Second, after
First, sequential control:
This is done by default from left to right, from top to bottom in a simple order. Uncontrolled process.
Second, branch control:Single branch, dual branch, multi-branch;Single-branch Syntax:
$age =17;if ($age
Two-branch
The role of 1:global is to define global variables, but this global variable is not applied to the entire site, but is applied to the current page, including all files of include or require.
Summary: Global variables defined in the function body
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
/* The main components and functions of the front-end controller are as follows: 1, the import file class controller; (the call to this system starts with this file, and it is equivalent to a control center that calls all related classes) 2.
For beginners in PHP, writing a 99 multiplication table with PHP is undoubtedly a classic exercise. Its test of logic is still quite in place.
The so-called difficult person will not, will not be difficult, for some veteran, this really is not what.
In PHP, we can use 3 ways to convert a string to an integer.
1. Coercion type conversion Mode
Coercion type conversion is the way to "precede the variable to be converted with a target type enclosed in parentheses".
For an integer type, the cast
Comparison operators allow two values to be compared. There are several comparison operators:
1) $a > $b greater than: Returns True if the $a is strictly greater than $b2) $a 3) $a >= $b greater than equals: Returns True if $a is greater than or
Through an example description:
5&& $b ++ ";//output $b=10, logic operation Short Circuit, $b not self-added, if ($a >5& $b ++ ";//output $b=11, bit operation is not short-circuit, $b self-added; //3. Bitwise NON, bitwise XOR, etc. is relatively
Look at the code first:
$a =8; $b =~ $a; Bitwise reverse echo "\ $a =". $a. " "; echo" \ $b = ". $b;
Output Result:
$a =8$b=-9
The result is different from what I thought, because in the PHP Chinese manual it says: ~ $a not (bitwise non) sets the
PHP Operators and expressions
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
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