Because we're using array_unique() and array_filter() the numerical index is thrown off and when it's written to JSON, the keys get written.
By running through array_values() this re-indexes the array starting at 0 and going up sequentially such that when it gets written to JSON, only the values are used.
Because we're using
array_unique()
andarray_filter()
the numerical index is thrown off and when it's written to JSON, the keys get written.By running through
array_values()
this re-indexes the array starting at 0 and going up sequentially such that when it gets written to JSON, only the values are used.