src/Peekmo/JsonPath/JsonStore.php
public function remove($expr)
    {
        if ((($exprs = $this->normalizedFirst($expr)) !== false) &&
            (is_array($exprs) || $exprs instanceof \Traversable)
        ) {
            foreach ($exprs as &$expr) {
                $o =& $this->data;
                $keys = preg_split(
                    "/([\"'])?\]\[([\"'])?/",
                    preg_replace(array("/^\\$\[[\"']?/", "/[\"']?\]$/"), "", $expr)
                );
                for ($i = 0; $i < count($keys) - 1; $i++) {
                    $o =& $o[$keys[$i]];
                }

                unset($o[$keys[$i]]);
            }

            return true;
        }

        return false;
    }
public function remove($expr)
    {
        if ((($exprs = $this->normalizedFirst($expr)) !== false) &&
            (is_array($exprs) || $exprs instanceof \Traversable)
        ) {
            foreach ($exprs as &$expr) {
                $o =& $this->data;
                $keys = preg_split(
                    "/([\"'])?\]\[([\"'])?/",
                    preg_replace(array("/^\\$\[[\"']?/", "/[\"']?\]$/"), "", $expr)
                );
                for ($i = 0; $i < count($keys) - 1; $i++) {
                    $o =& $o[$keys[$i]];
                }

                unset($o[$keys[$i]]);
            }

            return true;
        }

        return false;
    }
public function remove ( $ expr ) { if ( ( ( $ exprs = $ this -> normalizedFirst ( $ expr ) ) !== false ) && ( is_array ( $ exprs ) || $ exprs instanceof \ Traversable ) ) { foreach ( $ exprs as & $ expr ) { $ o = & $ this -> data ; $ keys = preg_split ( "/([\"'])?\]\[([\"'])?/" , preg_replace ( array ( "/^\\$\[[\"']?/" , "/[\"']?\]$/" ) , "" , $ expr ) ) ; for ( $ i = 0 ; $ i < count ( $ keys ) - 1 ; $ i ++ ) { $ o = & $ o [ $ keys [ $ i ] ] ; } unset ( $ o [ $ keys [ $ i ] ] ) ; } return true ; } return false ; }
Removes all elements matching the given jsonpath expression
@param string $expr JsonPath expression
@return bool returns true if success
Removes all elements matching the given jsonpath expression