Using grep is a good suggestion, but I don't think it'd work for me in this case because the array typically consists of nested values. In other words, $tmp
.... or something like that. I could design the logic to backtrack and do these checks, but it just makes more sense to parse through them one by one.