epiclesys/value-matcher
最新稳定版本:1.0.3
Composer 安装命令:
composer require epiclesys/value-matcher
包简介
README 文档
README
A simple PHP library for searching json values inside json or sub-arrays inside arrays.
Installation
You can install this package via Composer:
composer require epiclesys/value-matcher
Mach json values inside other json
Say we need to check if this json value
{ "key" : ["value"] };
is contained somewhere here
{
"level9": {
"finalLevel": "reached",
"stillGoing": true,
"data" : { "key" : ["one", 2, "value"] }
}
}
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use Epiclesys\ValueMatcher\JsonMatcher; $needle = '{ "key" : ["value"] }'; $haystack = ' { "level9": { "finalLevel": "reached", "stillGoing": true, "data" : { "key" : ["one", 2, "value"] } } }'; JsonMatcher::contains($needle, $haystack); // true
Similarly works for matching array values inside another array
ArrayMatcher::contains($needle, $haystack); // true
This project is licensed under the MIT License.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-06