fuel/fuel/core/classes/arr.php
public static function keyval_to_assoc($array, $key_field, $val_field)
	{
		if ( ! is_array($array) and ! $array instanceof \Iterator)
		{
			throw new \InvalidArgumentException('The first parameter must be an array.');
		}

		$output = array();
		foreach ($array as $key => $value)
		{
			$output[] = array(
				$key_field => $key,
				$val_field => $value
			);
		}

		return $output;
	}
public static function keyval_to_assoc($array, $key_field, $val_field)
	{
		if ( ! is_array($array) and ! $array instanceof \Iterator)
		{
			throw new \InvalidArgumentException('The first parameter must be an array.');
		}

		$output = array();
		foreach ($array as $key => $value)
		{
			$output[] = array(
				$key_field => $key,
				$val_field => $value
			);
		}

		return $output;
	}
public static function keyval_to_assoc ( $ array , $ key_field , $ val_field ) { if ( ! is_array ( $ array ) and ! $ array instanceof \ Iterator ) { throw new \ InvalidArgumentException ( 'The first parameter must be an array.' ) ; } $ output = array ( ) ; foreach ( $ array as $ key => $ value ) { $ output [ ] = array ( $ key_field => $ key , $ val_field => $ value ) ; } return $ output ; }
Converts an array of key => values into a multi-dimensional associative array with the provided field names

@param   array   $array      the array to convert
@param   string  $key_field  the field name of the key field
@param   string  $val_field  the field name of the value field
@return  array
@throws  \InvalidArgumentException
Converts an array of key = > values into a multi - dimensional associative array with the provided field names