PHPExcel如何从单元格获取列索引 [英] PHPExcel how to get column index from cell

查看:314
本文介绍了PHPExcel如何从单元格获取列索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHPExcel $ cell-> getColumn()返回'A','B','C',...

PHPExcel $cell->getColumn() returns 'A', 'B', 'C', ...

这是从单元格中获取整数(0、1、2,...)的最佳方法.

which is the best way to get the integer (0, 1, 2, ...) from the cell.

此功能不存在.

$colIndex = $cell->getColumnIndex();

那么,将chr转换为ascii的替代方法是什么?

So what is the alternative withoput converting chr to ascii ?

推荐答案

$colIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn());

这篇关于PHPExcel如何从单元格获取列索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆