J'ai fait une fonction assez simple pour tester si ma variable est vide ou non
Si elle est vide, la variable de sortie prend la valeur du commentaire Echec
Sinon ma variable de sortie prend la valeur de ma variable de Test
J'avais fait ca.
Code : Tout sélectionner
$test = testVarVide($upt1, $uptSync, "Echec");
echo "test = ".$test;
Code : Tout sélectionner
function testVarVide ($varTest, $varSortie, $comEchec)
{
if (empty($varTest))
{
$varSortie = $comEchec;
}
else
{
$varSortie = $varTest;
}
}