O'Reilly logo

PHP for Teens by Maneesh Sethi

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

Operators

An operator is a helper in PHP that deals with one or more values and returns a different value. This may seem very vague, but operators are everywhere. Think about a math class. When you do basic addition, what are you doing? You are taking in two values (7 and 5, for example), adding them together (7 + 5), and receiving a different value (12). In this case, the plus sign is the operator causing the change.

Think about the gettype() function that we went over in Chapter 4. This function takes in a variable name and returns its type. This function is an operator because it takes in a value (the variable) and results in something different (a type). Sure, these two pieces of data may be different, but the function still acts upon it! ...

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