Skip to content

Kirby 6.0.1

$value->toJson()

Converts the object to a JSON string; returns an empty string if the value cannot be encoded (e.g. invalid UTF-8), which results in an empty cache entry that is treated as a miss

$value->toJson(): string

Return type

string

Parent class

Kirby\Cache\Value