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.

Required fields*

2
  • 1
    Clever idea, but there's a bug. "$array[] = $value" doesn't add all the elements of $value to $array, it merely add $value itself. If you run this code, it will loop indefinitely. Commented Aug 24, 2009 at 0:29
  • Yes, shifting the value off the array and appending it again to the end doesn't make much sense. I guess you wanted to array_merge() instead? Commented Aug 24, 2009 at 0:37