d
Amit DhamuSoftware Engineer
 

Conditional Vs Ternary

1 minute read 00000 views
// Conditional Statement
if ($value === '') {
    echo 'Value is empty';
} else {
    echo 'Value is NOT empty';
}

// Ternary Operator
echo $value == '' ? 'Value is empty' : 'Value is NOT empty';