Use array_replace_recursive in getJsonAttribute