note 42375 deleted from function.chr by danbrown
| From: | danbrown@php.net | Date: | Wed, 15 Sep 2010 21:16:35 +0000 |
| Subject: | note 42375 deleted from function.chr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172605@lists.php.net to get a copy of this message | ||
Note Submitter: tippy2k
----
Working on the same thing as jmartin today. 701 is the limit of the script, 'ZZ'. This
should work a little faster. Hope it helps.
<?
function SSkey($xkey+1) {
$prefix = chr(floor($xkey+1 / 26)+64);
if($prefix == chr(64)) unset($prefix);
$suffix = chr($xkey+1 - (floor($xkey+1 / 26)*26) +64);
if($suffix == chr(64)) {
$prefix = chr( ord($prefix) -1);
if($prefix == chr(64)) unset($prefix);
$suffix = 'Z';
}
$sskey = "$prefix$suffix";
return $sskey;
}
?>