mercredi 18 mars 2020

Logic with running boolean on if condition

There might be something very obvious here and I can't solve for it maybe because I have been looking at it for too long?

$sample1 = "123456789";
$sample2 = array("123456780","123456781"); 

//more code in between

if (in_array($sample1,$sample2))
echo "Exists";
else
echo "Does not exist";

Any guidance is appreciated!

Aucun commentaire:

Enregistrer un commentaire