In short - I have two $ XML and $ DB arrays, both have values like code.
I foreach the first one, I'm downloading the code and looking for it in the second $DB. If $DB contains the code - I'll display the information that exists, if not - it does not. At least I would like it to be - because instead of the information that the key is in the array, I get else
$XML = array(
array(
"code" => 456,
),
array(
"code" => 789,
),
);
$DB = array(
array(
"code" => 456,
),
array(
"code" => 789,
),
);
foreach ($XML as $product) {
if (array_key_exists($product['code'], $DB)) {
echo "Key is in DB array";
} else {
echo "Key isn't in DB array";
}
}
$DBarray are 0 and 1.$DBor do a nested loop.