Home > php教程 > php手册 > body text

PHP操作符的种类概览

php.cn
Release: 2016-06-13 11:08:05
original
1273 people have browsed it

1)赋值操作符:=

2)算术操作符:+,-,*,/,%(取模)

3)连接操作符:. ,无论操作数是什么,都当成String,结果返回String

4)合计赋值操作符(Combined Assignment Operators):+=,*=,/=,-=,%=,.=

5)自动增减操作符(Automatically Incrementing and Decrementing):

(1)$variable+=1 ⇔$variable++;$variable-=1 ⇔$variable-,跟c语言一样,先做其他操作,后++或-

(2)++$variable,-$variable,先++或-,再做其他操作

6)比较操作符:

= =(左边等于右边),!=(左边不等于右边),
= = =(左边等于右边,且数据类型相同),
>=,>,

7)逻辑操作符:|| or,&& and,xor(当左右两边有且只有一个是true,返回true),!


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Latest issues
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!