$name = $_GET['name'] ?? $_POST['name'] ?? 'nobody'; //it is equavelent to below conditions if (isset($_GET['name'])) { $name = $_GET['name']; } elseif (isset($_POST['name'])) { $name = $_POST['name']; } else { $name = 'nobody'; }