PHP运算符的类别概览
PHP运算符1. 算数运算符
PHP算数运算符有+(加)、-(减)、*(乘)、/(除)、%(取余)。
PHP运算符2. 赋值运算符
PHP赋值运算符有+=(将左边的值加上右边的值赋值给左边)、-=(将左边的值减去右边的值赋值给左边)、*=(将左边的值乘以右边的值赋值给左边)、 /=(将左边的值除以右边的值赋值给左边)、%=(将左边的值对右边的值取余赋值给左边)、.=(将左边的字符串连接到右边赋值给左边)。
PHP运算符3.字符串运算符
PHP字符串运算符只有连接符号“.”,它将两个字符串连接起来。
PHP运算符4. 自增自减运算符
PHP自增自减运算符有四种形式:$a++; ++$a; $a--; --$a。
PHP运算符5. 逻辑运算符
PHP逻辑运算符有!(逻辑非)、and(逻辑与)、&&(逻辑与)、or(逻辑或,两个表达式只要有一个为真,结果就为真)、||(逻辑或)、xor(异或,两个表达式有且只有一个为真,结果才为真)。
和||的优先级比and和or高。
PHP运算符6. 位运算符
位运算符是把所有的数转换成二进制数来计算。
位运算符有&(按位与)、|(按位或)、^(按位异或)、>(按位右移)、~(按位取反)。
PHP运算符7. 关系运算符
关系运算符有==(等于)、!=(不等于)、(大于)、=(大于等于)。
PHP运算符8. 其他运算符
PHP运算符还有一些运算符,如$(变量符号)、&(变量指针,取地址)、@(加在函数前,不显示错误信息)、?:(三目运算符)、,(逗号运算符)、->(对象的方法和属性)、=>(数组赋值)。
PHP运算符9. 运算符优先级
PHP运算符有优先级,多种运算符在一起时,先算优先级高的。简单的理解就是先乘除后加减,这里不再赘述。

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.