1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

PHP: The Ternary operator in PHP

  1. Clicks today:
    0
  2. Clicks this month:
    0
  3. Overall rating:
    4.00/5

PHP » Basics — almost 8 years ago
The Ternary comparison operator is an alternative to the if-else statement, it's shorter and could be used to easily do a significant difference depending on a condition without the need of a if statement. The Ternary operator is made for two different actions, one if the condition is true, the other one if it's false but with nested Ternary operators we can use it like an if-elseif.else statement(more to that later).

Comments

Your Comment

You must be logged in to post a comment.