xlsxwriter.class.php
public static function add_to_list_get_index(&$haystack, $needle)
	{
		$existing_idx = array_search($needle, $haystack, $strict=true);
		if ($existing_idx===false)
		{
			$existing_idx = count($haystack);
			$haystack[] = $needle;
		}
		return $existing_idx;
	}
public static function add_to_list_get_index(&$haystack, $needle)
	{
		$existing_idx = array_search($needle, $haystack, $strict=true);
		if ($existing_idx===false)
		{
			$existing_idx = count($haystack);
			$haystack[] = $needle;
		}
		return $existing_idx;
	}
------------------------------------------------------------------