src/Arrays.php
public static function value_to_key($data, $column)
	{
		/* init the return array */
		$return = array();

		/* itterate over all the elements */
		foreach ($data as $key => $val)
		{
			if (is_object($val))
			{
				$return[$val->$column] = $val;
			}
			else
			{
				$return[$val[$column]] = $val;
			}
		}

		/* return the array */
		return $return;
	}
public static function value_to_key($data, $column)
	{
		/* init the return array */
		$return = array();

		/* itterate over all the elements */
		foreach ($data as $key => $val)
		{
			if (is_object($val))
			{
				$return[$val->$column] = $val;
			}
			else
			{
				$return[$val[$column]] = $val;
			}
		}

		/* return the array */
		return $return;
	}
public static function value_to_key ( $ data , $ column ) { /* init the return array */ $ return = array ( ) ; /* itterate over all the elements */ foreach ( $ data as $ key => $ val ) { if ( is_object ( $ val ) ) { $ return [ $ val -> $ column ] = $ val ; } else { $ return [ $ val [ $ column ] ] = $ val ; } } /* return the array */ return $ return ; }
column of array to key

@param array $data the data to process
@param mixed the column to store as the array key
@return the processed array
column of array to key