static function arrayUnset(&$var, $key) {
        $toks = explode('.', $key);
        $toks_len = count($toks);
        $last = null;
        
        for ($i = 0; $i < $toks_len - 1; $i++) {
            $var = &$var[$toks[$i]];
        }

        if (isset($toks[$toks_len - 1])) {
            $last = $toks[$toks_len - 1];
        }

        if ($last) unset($var[$last]);
    }
static function arrayUnset(&$var, $key) {
        $toks = explode('.', $key);
        $toks_len = count($toks);
        $last = null;
        
        for ($i = 0; $i < $toks_len - 1; $i++) {
            $var = &$var[$toks[$i]];
        }

        if (isset($toks[$toks_len - 1])) {
            $last = $toks[$toks_len - 1];
        }

        if ($last) unset($var[$last]);
    }
static function arrayUnset ( & $ var , $ key ) { $ toks = explode ( '.' , $ key ) ; $ toks_len = count ( $ toks ) ; $ last = null ; for ( $ i = 0 ; $ i < $ toks_len - 1 ; $ i ++ ) { $ var = & $ var [ $ toks [ $ i ] ] ; } if ( isset ( $ toks [ $ toks_len - 1 ] ) ) { $ last = $ toks [ $ toks_len - 1 ] ; } if ( $ last ) unset ( $ var [ $ last ] ) ; }
Remove array key using dots to traverse keys

$arr = ['test' => ['word' => 'hello']];
arrayUnset($arr, 'sample.word');

@access  public
@param   array   $var    Local declared variable
@param   string  $key    Array key
@param   mixed   $val    Value
@return  void
Remove array key using dots to traverse keys