Learn Php

Php Null Coalescence

Since PHP 7, you can use, null coalescing operator ?? , it eleminates the need to check if the variable is not NULL before accessing its value, Before PHP 7 you needed isset() function for checking. The Null coalescing operator comes to save your time, its returns the first operand if it's exists and is not NULL , otherwise the second operand returned. Here is an example: <?php    // if room is not passed    $room = $_GET['room'] ?? 13;    p...