For a php Tutorial written by a hacker, we suggest you learn php. later, this will inevitably go up to the next level today... first write one: (number addition)
The code is as follows:
$ A = "10"; // connect "to the left
$ A + = "2"; // add "on the right" to the left
Echo $ ."
\ N "; // here the result is 12, which means that $ a is equal to 10, and then 2 is added to the left (that is, $ a), so it is 12.
?>
In my opinion, php statements focus on the concept of line. Whatever $ a represents, it generally means connecting to the right. "connecting to" or "adding" or "reducing ,! It is not just a combination of numbers. Other methods are also supported.
Write another one: (right to left)
The code is as follows:
$ B = "Bad Wolf ";
$ B. = "good guy! ";
$ B. = "good guy! ";
Echo $ B. "haha! \ N "; // display the final content!
?>
Why is the result displayed like this? If you listen carefully every time, the previous section will say that the program runs from top to bottom and from right to left.
Write another one: (division)
The code is as follows:
$ A = "65896255618562314793123219"; // complicated computing Here. the original php processing is simple here!
$ A/= "465342233234234"; // multiply the two numbers!
Echo $ a. "success this is the result! 65896255618562314793123219 divided by 465342233234234, wow, ordinary people's arithmetic is not as fast as me! Haha @! \ N"
?>
Expected result 141608156132 is displayed. the calculation speed is really fast ......
Next step:
1. bitwise operations (this is rarely used)
& Represents and (and)
| Represents or (or)
^ Indicates mutual exclusion (Xor)
<Want to shift left
> Shift to the right
~ Take the secondary number of 1
2. logical operations (conditions, etc)
<Represents less
> Greater
<= Less than or equal
> = Greater than or equal
= (Generally, check whether a user's login is equal to or not)
! = Not equal
& And (and)
| Or (or)
Xor)
! No (Not)
Other symbols
3. Other operations
$ Variable (used many times)
& Variable indicators (before a variable)
@ Do not display the error message (before the function)
Example
The code is as follows:
@ Include ("dbx.txt"); // If dbx.txt does not exist, an error is reported, but it is not displayed after @ is added!
Echo"
\ N ";
?>
-> Object methods or attributes
=> Array element value
? : Triplicate operator
Remember the above, (but it is not that easy to remember, huh, huh !)
Next we will introduce the higher level, which is also the key to writing programs!
1. if (judgement) of a single row)
If... else...
If... what is... how is the result... is responsible... how...
If you are fat... you are a pig... otherwise... you are a thin monkey.
If (conditon) {statment1} true
Else {statment2} false
Example:
$ A = 4.998;
If ($ a> 5) // no extra points are required here. Note!
{
Echo "Yes! A> 5 \ n ";
}
Else // no extra points are required here. Note!
{
Echo "error! A <5 \ n ";
}
?>
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