本文整理汇总了PHP中PHPExcel_Cell::columnByIndexFromString方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Cell::columnByIndexFromString方法的具体用法?PHP PHPExcel_Cell::columnByIndexFromString怎么用?PHP PHPExcel_Cell::columnByIndexFromString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Cell
的用法示例。
在下文中一共展示了PHPExcel_Cell::columnByIndexFromString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: str_replace
$csvFileName = str_replace('.xlsx', '.csv', $uploadfile);
$objWriter->save($csvFileName);
if (($handle = fopen($csvFileName, "r")) !== false) {
while (($data = fgetcsv($handle, 1000, ",")) !== false) {
$num = count($data);
for ($c = 0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";
}
}
fclose($handle);
}
$objReader = new PHPExcel_Reader_Excel5();
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load("uploadfile");
$colunas = $objPHPExcel->setActiveSheetIndex(0)->getHighestColumn();
$totalColunas = PHPExcel_Cell::columnByIndexFromString($colunas);
$totalLinhas = $objPHPExcel->setActiveSheetIndex(0)->getHighetRows();
for ($linha = 1; $linha <= $totalLinhas; $linha++) {
for ($coluna = 0; $coluna <= $totalColunas; $coluna++) {
if ($linha == 1) {
echo utf8_decode($objPHPExcel->getActiveSheet()->getCellColumnAndRow($coluna, $linha)->getValue());
} else {
echo utf8_decode($objPHPExcel->getActiveSheet()->getCellColumnAndRow($coluna, $linha)->getValue());
}
}
}
}
?>
</body>
</html>