PHP Shorthand (Ternary) If / Else statement explained and examples
IF/ELSE is an essential part of any programming language. However, many times they can be too long and confusing. Shorthand (Ternary) operator ( ? : ) uses [condition] ? [return if true] : [return if false] structure to shorten your if/else structures. This is a great way to write clean code when you use a lot of IF / ELSE statement in your program.