Bad Wolf's PHP Learning Tutorial Day 3 Page 1/2_PHP Tutorial
Today I’ve taken it to the next level... First write one: (adding numbers)
$a = "10"; //"Connect" the right side to the left side
$a += "2"; //"Add" the right side to the left side
echo $a."
n"; //The result here is 12, which probably means that $a is equal to 10, and then add 2 to the left (which is $a), so it is 12.
?>
I think PHP writing pays great attention to the concept of rows. No matter what $a represents, it probably means right to left. "Connect to" or "Add to" or "Reduction to" etc.,! is not just the addition of numbers. There are other ways.
Write another: (right connection to left content)
$b = "Bad Wolf";
$b .= "Good guy!";
$b .= "Good guy!";
echo $b."Haha!n"; //Display the final content!
?>
Why are the results displayed like this? If you listen carefully every time, you will say in the previous paragraph: The running method of the program is from top to bottom, from right to left.
Write another one: (for division)
$a = "65896255618562314793123219"; //Complex calculation here, it turns out that php handles it here easily!
$a /= "465342233234234"; //Multiply these two numbers!
echo $a."←This is the result! 65896255618562314793123219 Except for 465342233234234, wow ordinary people are not as fast as me! Haha@! N "
? & Gt;
Get results 141608156132, the speed is really fast, haha .... ..
Continue to the next big step:
1. Bit operation (this is rarely used)
& stands for and (and)
| stands for or (or)
^ represents mutual exclusion (Xor)
<< Want to shift left
>> Shift right
~ Take the auxiliary number of 1
2. Logical operations (conditions, etc.)
< means less than
> means greater than
<= less than or equal to
>= greater than or equal to
== equal to (general checks such as the user's login is not equal to the condition)
!= is not equal to
&& and and (and)
|| or or (or)
xor mutually exclusive (Xor)
! Not (Not)
Other symbols
3. Other operations
$ variables (used many times)
& indicators of variables (added before variables)
@ do not display error messages (added before functions)
Examples
@include("dbx.txt"); / /If dbx.txt does not exist, an error will be reported, but it will not be displayed after adding @!
echo "
n";
?>
-> The method or attribute of the object
=> The element value of the array
?: Three far operators
Just remember the above, (But it’s not that easy to remember, haha!)
The higher-level ones are introduced below, which are also the more commonly used and key ones when writing programs!
1. Single-line if (judgment)
if. ..else...
If...what, what...what will be the result...responsible...how...
If...you are fat...you are a piglet... Otherwise... you are a skinny monkey.
if(conditon) { statment1} true
else {statment2} false false
Example:
$a = 4.998;
if($a > 5) //No semicolon is needed here, pay attention!
{
echo "Yes! a > 5n";
}
else // No semicolon is needed here, pay attention!
http://www.bkjia.com/PHPjc/319111.html
www.bkjia.com

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide
