$obj->toJson()
Converts the object to a json string
$obj->toJson(int $flags = 0, int $depth = 512): non-empty-string
Parameters
| Name | Type | Default |
|---|---|---|
| $flags | int |
0
|
| $depth | int |
512
|
Return type
non-empty-string
Exceptions
| Type | Description |
|---|---|
JsonException |
for invalid JSON |