operators:php operators

php operatorsthis section lists the different operators used in php.
arithmetic operators

+ 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

assignment operators

= 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

comparison operators

== is equal to 5==8 returns false
!= is not equal 5!=8 returns true
> is greater than 5>8 returns false
< is less than 5<8 returns true
>= is greater than or equal to 5>=8 returns false
<= is less than or equal to 5<=8 returns true

logical operators

&& and x=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

本文链接http://www.cxybl.com/html/wlbc/Php/20120531/27128.html

时间: 2024-10-08 09:41:03

operators:php operators的相关文章

Operators and Assignments(1)

5)Operators and AssignmentsObjective 1)Determine the result of applying any operator including assignment operators and instanceof to operands of any type class scope or accessibility or any combination of these.1.    Unary operators.1.1    Increment

Operators and Assignments(2)

Objective 2) Determine the result of applying the boolean equals(Object) method to objects of any combination of the classes java.lang.String java.lang.Boolean and java.lang.Object. The equals method can be considered to perform a deep comparison of

win8-access control assistance operators

问题描述 access control assistance operators 在win8.1 的 计算机管理 本地用户和组中,今天 突然发现 access control assistance operators 这个组, 想删除掉它 提示 无法删除 无法使用内置用户 删除 删除掉 对于 使用系统有没有太大影响? 如何才能删掉它? 解决方案 http://zhidao.baidu.com/link?url=nN7KQRTeMc3_VnRtaT8KW9RIHLRxGRlxbVm7IaY2NfG

Effective C++ 读书笔记之Part2.Constructors, Destructors, and Assignment Operators

5.Know what functions C++ silently writes and calls. 总结:编译器可以暗自为class创建default构造函数.copy构造函数.copy assginment操作符,以及析构函数.这些函数都是public的,并且是inline的. 6.Explicitly disallow the use of compiler-generated functions you to not want. 总结:为驳回编译器自动(暗自)提供的机能,可将相应的成

Java的位运算(bitwise operators)

Java的位运算(bitwise operators)直接对整数类型的位进行操作,这些整数类型包括long.int.short.char和 byte,位运算符具体如下表: 运算符 说明 << 左移位,在低位处补0 >> 右移位,若为正数则高位补0,若为负数则高位补1 >>> 无符号右移位,无论正负都在高位补0 & 与(AND),对两个整型操作数中对应位执行布尔代数,两个位都为1时输出1,否则0. | 或(OR),对两个整型操作数中对应位执行布尔代数,两个位

Conversion Operators in OpenCascade

Conversion Operators in OpenCascade eryar@163.com Abstract. C++ lets us redefine the meaning of the operators when applied to objects. It also lets us define conversion operations for class types. Class-type conversions are used like the built-in con

Basic Operators Of Swift 2.1

原文出自:标哥的技术博客 前言 运算符是检查.改变或合并值的特殊符号或短语.例如:加号+将两个数相加.更复杂的运算例子包括逻辑与运算符&&或让i值加1的便捷自增运算符++i等. Swift支持大部分标准C语言的运算符,且改进许多特性来减少常规编码错误.例如:赋值符不返回值,以防止把想要判断相等运算符的地方写成赋值符导致的错误.算术运算符(+,-,*,/,%等)会检测并不允许值溢出,以此来避免保存变量时由于变量大于或小于其类型所能承载的范围时导致异常.当然允许你使用Swift的溢出运算符来实

Swift学习之九:基本运行符(Basic Operators)

基本运行符: +(加法.正数) - (减法.负数) *  (乘法) / (除法) % (求余)  : 在Swift中,求余可以是浮点数求余. &&(逻辑与)  || (逻辑或) ^ (逻辑异或)  表示范围的符号:..和...(两个点:不包括下界和三个点包括下界) ++, -- 赋值操作符 // 赋值操作符=,表示把某个值赋给对应的常量或者变量 let b = 10 var a = 5 如果右边的赋值是一个元组,那么可以分解成多个常量或者变量: // x = 1, y = 2 let (x

换了iText-2.1.7生成pdf报错:Unbalanced save/restore state operators.

问题描述 原来用的是iText-2.0.2,能正常生成pdf文件,后来换成iText-2.1.7,生成pdf报错,报错信息如下:com.lowagie.text.exceptions.IllegalPdfSyntaxException:Unbalancedsave/restorestateoperators.atcom.lowagie.text.pdf.PdfContentByte.sanityCheck(UnknownSource)atcom.lowagie.text.pdf.PdfConte