Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

NetTuts.com:
The Ternary Operator in PHP
May 29, 2015 @ 16:41:44

If you're relatively new to the PHP language, there's an interesting "shorthand" method for evaluation that you may not know about. In this new tutorial from NetTuts.com they show you this handy method - the ternary operator.

The ternary operator allows us to simplify some PHP conditional statements. We'll see how it can be used, with test-driven development and refactoring, to simplify code.

While the tutorial is largely a screencast, they do provide a quick summary of what the operator is mainly used for and an example for quick reference.

tagged: ternary operator tutorial screencast introduction evaluation

Link: http://code.tutsplus.com/tutorials/the-ternary-operator-in-php--cms-24010


Trending Topics: