Answers for "?? ternary operator in php"

PHP
11

php ternary operator

(Condition) ? (Statement1) : (Statement2);
Posted by: Guest on April-23-2020
6

ternary operator in php

<?php
$marks=40;
print ($marks>=40) ? "pass" : "Fail";
?>
Posted by: Guest on July-03-2020
1

?? ternary operator in php

echo $color = $color ?? 'red';	//if value not exists then assign to them.
Posted by: Guest on September-03-2021
0

php ternary operator good example

<?php

$is_user_logged_in = false;

$title = $is_user_logged_in ? 'Logout' : 'Login';Code language: HTML, XML (xml)
Posted by: Guest on June-24-2021

Browse Popular Code Answers by Language