PHP Expression: Introduction
PHP Expression Step by Step Tutorial: Expression is a form which is yielding a value. In the simple form, it can be in the form of variable or konstanta and in the form of more complex, it entangles an operator and operand.
Take a look at the example as following:
20 + 4 * 5
representing an expression form yielding value 40. In this case 20, 4 and 5 is called as operand while the sign + and * personates operator.
The most basic forms of expressions are constants and variables. When you type "$a = 5", you're assigning '5' into $a. '5', obviously, has the value 5, or in other words '5' is an expression with the value of 5 (in this case, '5' is an integer constant).
After this assignment, you'd expect $a's value to be 5 as well, so if you wrote $b = $a, you'd expect it to behave just as if you wrote $b = 5. In other words, $a is an expression with the value of 5 as well. If everything works right, this is exactly what will happen.
Tag: expression Category: PHP Basic Post : March 08th 2008 Read: 430
blog comments powered by Disqus
