YoastSEO_Vendor\GuzzleHttp
json_encode() Yoast 1.0
Wrapper for JSON encoding that throws when an error occurs.
Хуков нет.
Возвращает
Строку.
Использование
json_encode( $value, $options, $depth );
- $value(смешанный) (обязательный)
- The value being encoded
- $options(число)
- JSON encode option bitmask
По умолчанию: 0 - $depth(число)
- Set the maximum depth. Must be greater than zero.
По умолчанию: 512
Код json_encode() json encode Yoast 15.7
function json_encode($value, $options = 0, $depth = 512)
{
$json = \json_encode($value, $options, $depth);
if (\JSON_ERROR_NONE !== \json_last_error()) {
throw new \InvalidArgumentException('json_encode error: ' . \json_last_error_msg());
}
return $json;
}