Answers for "<?= php"

PHP
2

?? php

?: // !empty()
?? // isset()
Posted by: Guest on December-31-2020
0

php ?:

// Example usage for: Ternary Operator
$action = $_POST['action'] ?: 'default';

// The above is identical to this if/else statement
if (empty($_POST['action'])) {
    $action = 'default';
} else {
    $action = $_POST['action'];
}
Posted by: Guest on April-24-2020

Browse Popular Code Answers by Language