if I just want results based on var
value set or not? so that I can simply use this
$lab_type=$label['type']??null;
but if want to compare $label['type']
response with using ??
operator, then how to do.
want to change it
<option value="background" <?= isset($label['type'])?$label['type']=='background'?'selected':'':'selected'?> >Background</option>
don't want to use isset
here.
Change your ternary operator to:
<?= ($label['type'] ?? null) == 'background' ? 'selected' : '' ?>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments