Bonjour,
Quand je fais : $_POST['maVariable'] et que je poste (via formulaire) 0 :
alors
$maVariable = (int)$_POST['maVariable']
vaut 0 -> OK
Si je fais
(isset(maVariable) ? (int) $_POST['maVariable'] : '')
alors j'ai 0 -> OK
Mais si je fais
(isset(maVariable) && !empty($_POST['maVariable']) ? (int) $_POST['maVariable'] : '')
alors j'ai (string) vide -> ???
Pouvez vous me dire pourquoi et quelle condition utiliser quand je poste 0 et que je veux comparer $maVariable avec $_POST['maVariable'] ? (ma variable est numérique)
Merci d'avance
Partager