in reply to iterating through array and saving matches to new array
No that was not what I meant by "working" - I posted my last comment too hastily, without sufficient testing.