array_combine Filter

Combines the values of the array, as keys, with the values of another array

{{ ['name', 'age']|array_combine(['George', 29])|json_encode }}

{# {"name":"George","age":29} #}