// Convert string 'A' to index 1 $colIndex = PHPExcel_Cell::columnIndexFromString('A'); echo $colIndex; // Output: 1
// Convert string 'AZ' to index 52 $colIndex = PHPExcel_Cell::columnIndexFromString('AZ'); echo $colIndex; // Output: 52In both examples, the method `columnIndexFromString` is used to convert a string representing an Excel column to a numeric index. This method is part of the PHPExcel_Cell class which is included in the PHPExcel package library.