承接 epiclesys/value-matcher 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

epiclesys/value-matcher

最新稳定版本:1.0.3

Composer 安装命令:

composer require epiclesys/value-matcher

包简介

README 文档

README

Latest Stable Version License

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-06