Conversion tables A-K
  Conversion tables L-Z
  SPAM database query
  Reverse WHOIS utility
  North America area codes
  PHP Example forums

PHP example repository.

Back to examples
Creating "EXCEL" style column headers

Simple script to create spreadsheet style column headers, ie AA, BD, D1 etc ( column number to string and visa-versa )

The script allows for a custom character set, so you can use your own characters or remove the numeric characters

The example shows the 2 functions, one to convert the number to the string, and one to convert the string back to the number.


//  This allows us to use a custom character list

$characters "abcdefghijklmnopqrstuvwxyz1234567890";

// How many characters are dealing with

$depth      strlen($characters);



$sCol="" ;
$nCol >= 0)
$sCol $characters[$nCol $depth] .$sCol
$nCol floor($nCol $depth) - ;

// Return the string

return $sCol;

// This is the inverse function

function String2Number($sCol)
$nCol 0;
    for (
$nCol $nCol $depth + (strpos($characters,substr($sCol,$i,1))+1) ;