Skip to content

Instantly share code, notes, and snippets.

View kahwee's full-sized avatar
🎯
Focusing

KahWee Teng kahwee

🎯
Focusing
  • Uber Technologies
  • San Francisco, CA
View GitHub Profile
@kahwee
kahwee / gist:2688051
Created May 13, 2012 11:59 — forked from uzyn/gist:2688024
array_merge recursive
class CMap2 {
/**
* Merges two or more arrays into one recursively.
* If each array has an element with the same string key value, the latter
* will overwrite the former (different from array_merge_recursive).
* Recursive merging will be conducted if both arrays have an element of array
* type and are having the same key.
* For integer-keyed elements, the elements from the latter array will
* be appended to the former array.