Object function reference

json

A reference entry for json

Object function · Response

json(mixed data) ⇒ string

Encodes a value as JSON, sets the response content type to application/json; charset=utf-8, and returns the encoded string.