static function GetColumnLetter($columnNumber)
	{
		// work with 1-based number
		$colNum = $columnNumber + 1;
		$code = "";
		
		if ($colNum > 26)
		{
			// greater than 26 means the column will be AA, AB, AC, etc.
			$left = floor($columnNumber / 26);
			$right = 1 + ($columnNumber % 26);

			if ($left > 26) throw new Exception("Columns exceed supported amount");
			
			$code = chr($left + 64) . chr($right + 64);
		}
		else
		{
			$code = chr($colNum + 64);
		}
		
		return $code;
		
		
	}
static function GetColumnLetter($columnNumber)
	{
		// work with 1-based number
		$colNum = $columnNumber + 1;
		$code = "";
		
		if ($colNum > 26)
		{
			// greater than 26 means the column will be AA, AB, AC, etc.
			$left = floor($columnNumber / 26);
			$right = 1 + ($columnNumber % 26);

			if ($left > 26) throw new Exception("Columns exceed supported amount");
			
			$code = chr($left + 64) . chr($right + 64);
		}
		else
		{
			$code = chr($colNum + 64);
		}
		
		return $code;
		
		
	}
static function GetColumnLetter ( $ columnNumber ) { // work with 1-based number $ colNum = $ columnNumber + 1 ; $ code = "" ; if ( $ colNum > 26 ) { // greater than 26 means the column will be AA, AB, AC, etc. $ left = floor ( $ columnNumber / 26 ) ; $ right = 1 + ( $ columnNumber % 26 ) ; if ( $ left > 26 ) throw new Exception ( "Columns exceed supported amount" ) ; $ code = chr ( $ left + 64 ) . chr ( $ right + 64 ) ; } else { $ code = chr ( $ colNum + 64 ) ; } return $ code ; }
Given a zero-based column number, the approriate Excel column letter is
returned, ie A, B, AB, CJ, etc.  max supported is ZZ, higher than that will
throw an exception.

@param int $columnNumber
Given a zero - based column number the approriate Excel column letter is returned ie A B AB CJ etc . max supported is ZZ higher than that will throw an exception .