json_encode()
function json_encode(mixed $value, int $flags = 0, int $depth = 512): string
Returns the JSON representation of a value.
Parameters:
$value(mixed)$flags(int), default0, optional$depth(int), default512, optional
Returns: string
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how json_encode is implemented in the compiler, see the internals page.