Beispiel #1
0
 function add(&$obj, $parentexpr, $value, $name = "")
 {
     $parent =& JsonStore::get($obj, $parentexpr);
     if ($name != "") {
         $parent[$name] = $value;
     } else {
         $parent[] = $value;
     }
 }
Beispiel #2
0
 protected function filterJSON($json, $path)
 {
     if (preg_match("/^\\\$/", $path)) {
         // jsonpath
         $store = new JsonStore($json);
         $result = $store->get($path);
     } else {
         // xpath
         $result = $this->xPathFilter("json", $json, $path);
     }
     return $result;
 }