brainplusplus/php-jsonpath 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

brainplusplus/php-jsonpath

Composer 安装命令:

composer require brainplusplus/php-jsonpath

包简介

JSONPath Library and Helper

README 文档

README

fork from https://code.google.com/archive/p/jsonpath

and add JsonPathHelper class

how to use :

$url = "https://api-ssl.bitly.com/v3/link/referrers?access_token=xxxxx&link=http://bit.ly/xxxxx";

for example json in that url is :

{"status_code": 200, "data": {"units": -1, "unit_reference_ts": null, "tz_offset": -4, "unit": "day", "referrers": [{"referrer": "https://t.co/", "clicks": 111}, {"referrer": "direct", "clicks": 99}, {"referrer": "android-app://com.twitter.android", "clicks": 81}, {"referrer": "/android-app://com.twitter.android", "clicks": 2}]}, "status_txt": "OK"}

$expr = "$..referrers.*";

echo "

Contoh ambil json string value

"; $result = JsonPathHelper::getJsonStringValueByUrl($url,$expr); echo $result;

echo "

Contoh ambil json string path

"; $result = JsonPathHelper::getJsonStringPathByUrl($url,$expr); echo $result;

echo "

Contoh ambil json object

"; $result = JsonPathHelper::getJsonValueByUrl($url,$expr); var_dump($result);

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固