201612.04
Désactivé
0

Ternary operator

$favoriteColor = isset($_POST["color"]) ? $_POST["color"] : "pink";

If a color parameter was passed in to the script from the URL, it’s value is assigned to $favoriteColor. If it wasn’t, the default value “pink” is assigned instead.