大网数据广告活动
PHP 语言与运行手册

simdjson_key_exists · Check if the JSON contains the value referred to by a JSON pointer.

· 52CE 我爱测

simdjson_key_exists — Check if the JSON contains the value referred to by a JSON pointer.

simdjson_key_exists

(PECL simdjson >= 2.0.0)

simdjson_key_exists — Check if the JSON contains the value referred to by a JSON pointer.

Description

function simdjson_key_exists(string $json, string $key, int $depth = ?): bool

Count the number of elements of the object/array found at the requested JSON pointer.

Parameters

json

The json string being queried.

key

The JSON pointer string.

depth

Maximum nesting depth of the structure being validated. The value must be greater than 0, and less than or equal to 2147483647. Callers should use reasonably small values, because larger depths require more buffer space and will increase the recursion depth, unlike the current json_decode() implementation.

throw_if_uncountable

When true, a SimdJsonException will be thrown instead of returning 0 when the value the JSON pointer points to is neither an object nor an array.

Return Values

Returns true if the JSON pointer is valid and refers to a value found within a valid JSON string. Returns false if the JSON is valid but does not contain the JSON pointer.

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。