$sanitizer→json()
Sanitize value to formatted and readable JSON string
If you do not need formatted/readable JSON string then use PHP’s json_encode() function instead.
Available since version 3.0.256.
Usage
// basic usage
$false = $sanitizer->json(mixed $value);
// usage with all arguments
$false = $sanitizer->json(mixed $value, array $options = []);Arguments
| Name | Type(s) | Description |
|---|---|---|
$value | mixed | |
$options (optional) | array |
|
Return value
false string
$sanitizer methods and properties
API reference based on ProcessWire core version 3.0.257