php set a variable if another there isn’t

If you want to get a php variable if another is not present, without using the if ... then syntax, you can use this code

$some_variable = $optimal_variable ?? $alternative_variable;

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *