这是phpexcel类中的方法。今天查到了,记录一下备忘。 public static function stringfromcolumnindex($pcolumnindex = 0){//using a lookup cache adds a slight memory overhead, but boosts speed//caching using a static within the method is faster t
这是phpexcel类中的方法。今天查到了,记录一下备忘。
public static function stringfromcolumnindex($pcolumnindex = 0) { // using a lookup cache adds a slight memory overhead, but boosts speed // caching using a static within the method is faster than a class static, // though it's additional memory overhead static $_indexcache = array(); if (!isset($_indexcache[$pcolumnindex])) { // determine column string if ($pcolumnindex 将列的数字序号转成字母使用:
phpexcel_cell::stringfromcolumnindex($i); // 从o开始
将列的字母转成数字序号使用:
phpexcel_cell::columnindexfromstring(‘aa’);
原文地址:php生成excel列名,超过26列大于z的方法, 感谢原作者分享。