Next, I have a saved array value in the $chaves
variable as in the example below:
array(2) {
[0] => array(1) {
["chave"] => string(1) "1"
}
[1] => array(1) {
["chave"] => string(1) "3"
}
}
I made a loop:
foreach ($chaves as $chave) {
if (in_array($row['chave'], $chave)) {
echo 'ok, é igual';
} else {
echo 'ok, não é igual';
}
}
However, it is printing like this "ok, it's okay, it's not the same", but it should print: "ok, it's not the same" when the value is different and "ok, it's the same" when the value is equal.
The idea is to show that it is the same when the key values are the same.