i have a foreach where i want to compare some strings from two arrays
output of variable $count_land
Array
(
["US"] => 186
["DE"] => 44
["BR"] => 15
["FR"] => 3
["other"] => 7
)
Other array:
$all_lands_array = ["CN", "DE", "US", "EU", "RU", "BR", "GB", "NL", "LU", "other", "IT"];
what i need is every key in the $all_lands_array that have the same letters from the $count_land array and save them in another variable
that means i need to get US, DE, BR, FR, other and save them in a new variable
i hope you understand what i need :)
this is my loop but it doesnt find any match.. but why?
foreach($all_lands_array as $lands){
if($lands == $count_land)
return "match";
else
return "no match!";
}