O'Reilly logo

Core PHP Programming: Using PHP to Build Dynamic Web Sites by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Expressions

Expressions are combinations of identifiers and operators. In most cases, they are the familiar formulas you learned about in high school algebra. They are executed from left to right; some operators are processed before others, and you can use parentheses to force an operation to occur before the rest of the expression. But since the expression may be a mix of different data types, you must be aware of how types are converted.

Listing 2.11. Using Assignment Operators
<?
     // this assignment
     $Count = $Count + 1;

     // is the same as this assignment
     $Count += 1;
?>

Two general rules are at work when an expression is evaluated. First, some operators work only on certain data types. Second, if the operation is on a mix of an integer and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required