Documentation

Jsonable

Interface to declare that instances can be converted into JSON strings.

It is recommended that classes that use the JsonTrait trait declare they implement this interface.

Table of Contents

toJson()  : string
Convert this object into a JSON string.

Methods

toJson()

Convert this object into a JSON string.

public toJson(int $options) : string
Parameters
$options : int

Options passed to json_encode(). This parameter is optional and its default value is 0.

Return values
string

A JSON string.

Search results