lundi 4 janvier 2016

One line if in Symfony2

$value = A
$value = ($value == "A") ? 1 : ($value == "B") ? 2 : ($value == "C") ? 3 : null;

On this way it's always returns 3. Where do I make a mistake?

Aucun commentaire:

Enregistrer un commentaire