I am trying to convert the map and grep code totally to foreach loop, but I am facing trouble when I do it.
map
grep
foreach
Here is the array code