I have an array of strings that $count_per_slot = [ "12", "9", "67", "120", "9", "67", "7" ]
and an array of which I will like to compare with the index of $count_per_slot
so I can get the value of the index that is equal to $index_to_compare
. The array of string to compare with is $index_to_compare = [ "3", "4" ]
I was able to get the array of the index of $count_per_slot
with the below code:
foreach($count_per_slot as $index => $row){
$index_of_count_per_slot = $row;
}
How do I compare $index_of_count_per_slot
to $index_to_compare
and any of the index that is true should return the value in $count_per_slot