Description:
Create an “if / else” check in one line.
Solution:
For assigning a value, or triggering a special function based on an “if / else” clause we can use the one line clause from PHP:
$our_variable = (is_this_true()) ? “value in case of true” : “value in case of false”;
Where is_this_true() is the function or variable that has to be checked for validity.