note 95515 deleted from function.chr by danbrown
| From: | danbrown@php.net | Date: | Thu, 07 Jan 2010 17:20:55 +0000 |
| Subject: | note 95515 deleted from function.chr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164756@lists.php.net to get a copy of this message | ||
Note Submitter: moloth at hotmail dot com
----
This is fixing the problem alphabet numbering system below:
<?php
//Recursive Function to do letter numbering with standard arrays
// 0=A 25=Z 26=AA 701=ZZ 702=AAA
function IntToAlpha($i) {
$imod = $i%26;
$idiv = floor($i/26);
$alpha_string=chr($imod+65);
return ($idiv>=1 ? (IntToAlpha($idiv-1)).$alpha_string : $alpha_string);
}
?>