Answers for "php shortest if else"

PHP
2

php if short form

<?php echo ($qte > 0) ? $qte : 0; ?>
Posted by: Guest on November-14-2020
0

turnery expression php

(condition) ? /* value to return if condition is true */ 
            : /* value to return if condition is false */ ;
echo empty($address['street2']) ? "Street2 is empty!" : $address['street2'];
Posted by: Guest on December-21-2020

Browse Popular Code Answers by Language