PHP Expression
Posted on: March 19, 2010 at 12:00 AM
In this tutorial we will study about PHP expression, expression could be anything we write. Examples in this simple tutorial will make it more clear.

PHP Expressions:

In every language expression plays a vital role, in PHP whatever you write is an expression (almost anything). Anything has a value is an expression and this is the easiest way to define and understand expression.

Variables and constants make an expression,

$var=323;

In the above example $var is a variable and 323 is a constant value.

Following examples will try to make the concepts more clear, hopefully you have the concept of  Expression functions in PHP:

PHP Regular Expression Example:

<?php

function disp()

{

$a=23;

return $a;

}

echo disp();

?>

Output:

23

Example:

<?php

function disp()

{

echo $a=23;

}

disp();

?>

Output:

23

Related Tags for PHP Expression:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.