phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


PHP Expression: Introduction

Tag: expression   Category: PHP Basic
post: 08 Mar 2008 read: 202


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.




| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting