src/classes/CCArr.php
public static function average( $arr, $key = null ) 
	{
		if( !is_array( $arr ) ) 
		{
			throw new \InvalidArgumentException('CCArr::average - first argunent has to be an array.');
		}

		if ( is_string( $key ) && CCArr::is_multi( $arr ) ) 
		{
			$arr = CCArr::pick( $key, $arr );
		}

		return ( static::sum( $arr ) / count( $arr ) );
	}
public static function average( $arr, $key = null ) 
	{
		if( !is_array( $arr ) ) 
		{
			throw new \InvalidArgumentException('CCArr::average - first argunent has to be an array.');
		}

		if ( is_string( $key ) && CCArr::is_multi( $arr ) ) 
		{
			$arr = CCArr::pick( $key, $arr );
		}

		return ( static::sum( $arr ) / count( $arr ) );
	}
public static function average ( $ arr , $ key = null ) { if ( ! is_array ( $ arr ) ) { throw new \ InvalidArgumentException ( 'CCArr::average - first argunent has to be an array.' ) ; } if ( is_string ( $ key ) && CCArr :: is_multi ( $ arr ) ) { $ arr = CCArr :: pick ( $ key , $ arr ) ; } return ( static :: sum ( $ arr ) / count ( $ arr ) ) ; }
get the average of the items

@param array[array]	$arr
@param string			$key
get the average of the items