in_associative_array PHP function

Pretty straightforward function for determining if associative array already contains value in specified array column.

function in_associative_array($needle, $haystack, $column, $nivo = 1)
{
	/*
		$haystack = array(
			[0] = array(
				"column1" => "value1",
				"column2" => "value2"
			),
			[1] = array(
				"column1" => "value1",
				"column2" => "value2"
			)	
		)	
	*/
	
	if ($nivo == 1)
	foreach($haystack as $item)
	{
		if (isset($item[ $column ]) && $item[ $column ] == $needle)
			return true;
	}
	
	/*
		$haystack = array(
			"column1" => "value1",
			"column2" => "value2",
			"column3" => "value1",
		)	
	*/	
	if ($nivo == 0)
	foreach($haystack as $key => $item)
	{
		if ($key == $column && $item == $needle)
			return true;
	}	
		
	
	return false;
}