Indeed you do. As you can see I gave the credits to the Y_Less for his foreach function in the main post. You also have the link there.
right...ermm this might be a noobish question, but I've downloaded it, well, copy/paste, and added it to a .inc file...now what? I tried #include <foreach> in the inc, and my Test GM.