Answers for "null collapse operator php"

PHP
2

php null coalesce

// if $_POST['name'] doesn't exist $result will equal to John
$result = $_POST['name'] ?? 'John';
Posted by: Guest on February-03-2020
0

null collapse operator php

$name = $_GET['name'] ?? $user_name ?: 'anonymous';
Posted by: Guest on December-11-2020

Browse Popular Code Answers by Language