public function execute($key = null, $default = null, $data = null) {

		//Matching type array
		if(is_array($key)) {

			foreach($key as $index) {

				if(!isset($data[$index])) {
					return $default;
				}

				$data = $data[$index];
			}

			return $data;
		}

		//Matching type string
		if($key && isset($data[$key])) {
			return $data[$key];
		}

		//Matching type string array
		$names = explode('[', $key);

		foreach($names as $index => $name) {

			$name = rtrim($name, ']');

			if(!isset($data[$name])) {
				return null;
			}

			$data = $data[$name];

			if($index == count($names) - 1) {
				$default = $data;
			}
		}

		return $default;
	}
public function execute($key = null, $default = null, $data = null) {

		//Matching type array
		if(is_array($key)) {

			foreach($key as $index) {

				if(!isset($data[$index])) {
					return $default;
				}

				$data = $data[$index];
			}

			return $data;
		}

		//Matching type string
		if($key && isset($data[$key])) {
			return $data[$key];
		}

		//Matching type string array
		$names = explode('[', $key);

		foreach($names as $index => $name) {

			$name = rtrim($name, ']');

			if(!isset($data[$name])) {
				return null;
			}

			$data = $data[$name];

			if($index == count($names) - 1) {
				$default = $data;
			}
		}

		return $default;
	}
public function execute ( $ key = null , $ default = null , $ data = null ) { //Matching type array
 if ( is_array ( $ key ) ) { foreach ( $ key as $ index ) { if ( ! isset ( $ data [ $ index ] ) ) { return $ default ; } $ data = $ data [ $ index ] ; } return $ data ; } //Matching type string
 if ( $ key && isset ( $ data [ $ key ] ) ) { return $ data [ $ key ] ; } //Matching type string array
 $ names = explode ( '[' , $ key ) ; foreach ( $ names as $ index => $ name ) { $ name = rtrim ( $ name , ']' ) ; if ( ! isset ( $ data [ $ name ] ) ) { return null ; } $ data = $ data [ $ name ] ; if ( $ index == count ( $ names ) - 1 ) { $ default = $ data ; } } return $ default ; }
Get value from array string
@param mixed $key
@param mixed $default
@param mixed $data
@return mixed
Get value from array string