Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • "I don't wanna use iteations" Commented Jun 29, 2012 at 16:03
  • 2
    D'oh! array_intersect_key it is then (with array_flip) Commented Jun 29, 2012 at 16:06
  • Not wanting to use Loop? This is the best/ clearest piece of code. Put it in a function, maybe use a foreach loop for improved readability... Commented Jul 7, 2012 at 5:47
  • @morphunreal: you may call it an excercise, but the specifications of the OP are quite clear. Anyone is able to write this loop. Commented Jul 7, 2012 at 8:24