ホームページ  >  記事  >  php教程  >  演算子:PHP 演算子

演算子:PHP 演算子

WBOY
WBOYオリジナル
2016-06-21 08:51:471030ブラウズ

php 演算子このセクションでは、php で使用されるさまざまな演算子をリストします。
算術演算子
演算子の説明例結果乗算代入演算子

比較演算子論理演算子
+ 加算 x=2operatordescriptionexampleresult
+ addition x=2
x+2
4
- subtraction x=2
5-x
3
* multiplication x=4
x*5
20
/ division 15/5
5/2
3
2.5
% modulus (division remainder) 5%2
10%8
10%2
1
2
0
++ increment x=5
x++
x=6
-- decrement x=5
x--
x=4
x+2
4
- td> 減算 x=2
5-x
3
*x=4operatorexampleis the same as
= x=y x=y
+= x+=y x=x+y
-= x-=y x=x-y
*= x*=y x=x*y
/= x/=y x=x/y
.= x.=y x=x.y
%= x%=y x=x%y
x*5
20
/ 除算 15/5
5/2
3operatordescriptionexample
== is equal to 5==8 returns false
!= is not equal 5!=8 returns true
> is greater than 5>8 returns false
<is less than5<8 returns true
>= is greater than or equal to 5>=8 returns false
<=is less than or equal to5<=8 returns true
2.5
%係数 (除算の余り)5%2
10%8operatordescriptionexample
&&andx=6
y=3 (x < 10 && y > 1) returns true
or x=6
y=3 (x==5 y==5) returns false
! not x=6
y=3 !(x==y) returns true
10%2
1

2
0

++ 増分 x=5
x++
x=6
-- デクリメント x=5

x--

x=4
演算子の説明例&&
and x=6y=3 (x 1) は true を返します
または x=6y=3 (x==5 y==5) は false を返します
! ではありません x=6y=3 !(x==y) は true を返します
本文http://www.cxybl.com/html/wlbc/Php/20120531/27128.html
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。