View Single Post
  #30 (permalink)  
Old 05-04-2008, 11:16 PM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: Operations in PHP

Hi,

Binary operators are used on two operands:
2 + 3
14 * 3.1415
$i – 1
These examples are also simple examples of expressions.
PHP can only perform binary operations on two operands that have the
same type. However, if the two operands have different types, PHP automatically
converts one of them to the other’s type, according to the following rules
(unless stated differently, such as in the concatenation operator).

Attachment 201

Booleans, nulls, and resources behave like integers, and they convert in
the following manner:
  • Boolean: False = 0, True = 1
  • Null = 0
  • Resource = The resource’s # (id)
Attached Files
File Type: doc sample.txt.doc (26.5 KB, 3 views)
__________________
Regards,
Senraj.A

Last edited by senraj : 05-05-2008 at 05:27 AM.
Reply With Quote