function jsonPath($obj, $expr, $args = null) { $jsonpath = new JsonPath(); $jsonpath->resultType = $args ? $args['resultType'] : "VALUE"; $x = $jsonpath->normalize($expr); $jsonpath->obj = $obj; if ($expr && $obj && ($jsonpath->resultType == "VALUE" || $jsonpath->resultType == "PATH")) { $jsonpath->trace(preg_replace("/^\\\$;/", "", $x), $obj, "\$"); if (count($jsonpath->result)) { return $jsonpath->result; } else { return false; } } }