Expressions are basically the most important element of PHP. In essence, anything that you write in PHP, anything that has a value, is considered an expression. If you create a statement that does something, it is generally an expression.
A very simple example of an expression—creating and assigning a variable—might look something like this:
$variablename = "value";
This creates a variable called variablename that is assigned to some value. Because "value" is a string, the variable $variablename will also be a string. See the semicolon at the end? That marks the end of a statement.
What is the difference between a statement and an expression?
Statements and expressions are both very common and very important. All statements are expressions, ...