<?php function numberToColumnName($number){ $abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $result = ""; $tmp = $number; while($number > $abc_len) { $remainder = $number % $abc_len; $result = $abc[$remainder-1].$result; } return $abc[$number-1].$result; } for($i = 0; $i < 50; $i++){ echo numberToColumnName($i)."\n"; }
Standard input is empty
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z AA AB AC AD AE AF AG AH AI AJ AK AL AM AN AO AP AQ AR AS AT AU AV AW
PHP Notice: Uninitialized string offset: -1 in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15 PHP Notice: String offset cast occurred in /home/RKZ7sS/prog.php on line 15