Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

?? Null Coalescing Operator PHP

<?php
// Example usage for: Null Coalesce Operator
$action = $_POST['action'] ?? 'default';

// The above is identical to this if/else statement
if (isset($_POST['action'])) {
    $action = $_POST['action'];
} else {
    $action = 'default';
}
?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #Null #Coalescing #Operator #PHP
ADD COMMENT
Topic
Name
1+8 =