PHP Tip: Tertiary Operator
Posted in Web Development on Feb 23rd, 2008 No Comments »
This is just a quick PHP tip I’d like to share. It’s called the Tertiary Operator. It’s basically a way to simplify simple(and complex) if statements into one liners!
Say for example you have a conditional statement like:
Code (php)
<?php
if (5 > 10)
{
echo ‘The world is ending.’;
}
else
{
echo […]
