选择语言 :

 Core_Arr::get

Retrieve a single key from an array. If the key does not exist in the array, the default value will be returned instead.

// Get the value "username" from $_POST, if it exists
$username = Arr::get($_POST, 'username');

// Get the value "sorting" from $_GET, if it exists
$sorting = Arr::get($_GET, 'sorting');
mixed Core_Arr::get( array $array , string $key [, mixed $default = null ] )

参数列表

参数 类型 描述 默认值
$array array Array to extract from
$key string Key name
$default mixed Default value null
返回值
  • mixed
File: ./core/classes/arr.class.php
public static function get($array, $key, $default = null)
{
	return isset($array[$key]) ? $array[$key] : $default;
}