Numeric equivalent of an Excel column name

I wrote this little php function to see how small I could make the code. I think I did pretty well and figured I would post it here as to not forget in case I needed to actually use it some day. There might be a better way, but I had some fun with this.

function b($b){$l=strlen($b);while($i<$l){$c+=(base_convert($b[$i],36,10)-9)*pow(26,$l-1-$i);$i++;}return $c;}

Comments are closed.