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*

3
  • Thank you for your attention for old my question. I agree with removing duplicated items after merging. However, in this way, there is key-value exists (example: "0", "1", ... "5", "7"). I just want to get an array with no index key. The point is that don't know deep the array. How about it? Commented Oct 20, 2021 at 11:42
  • @Silverstar You can achieve that quite easily by wrapping the array_unique in an array_values. I adjusted my answer to reflect this. Does this answer your question? Commented Oct 20, 2021 at 12:34
  • Certainly, your function is simpler and easy to understand than the function I have already created and implemented. Thank you. Commented Oct 20, 2021 at 23:03