如何在PHP中获取ods文件格式数据

时间:2016-04-15 14:08:00

标签: php ods

我在该文件中上传.ODS文件有6个字段& 1行,但当我使用下面的代码时,电子邮件不能获取,但其他数据显示。



$inputFileName = 'uploads/' . basename($_FILES['file']['name']);


               $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
                $objReader = PHPExcel_IOFactory::createReader($inputFileType);
                $objPHPExcel = $objReader->load($inputFileName);
    $sheet = $objPHPExcel->getSheet(0);
                $highestRow = $sheet->getHighestRow();
                $highestColumn = $sheet->getHighestColumn();                
                $response['Existing_Customers'] = array();

                $check_updated_data = array();

                for ($row = 2; $row <= $highestRow; $row++) {
                    //  Read a r ow of data into an array
                    $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE);
    //                echo "data";
                    $sr_no = $rowData[0][0];
                    $Cust_name = $rowData[0][1];
                    $Customer_No = $rowData[0][2];
                    $Customer_Email_id = $rowData[0][3];                
                    $Customer_Gender = $rowData[0][4];
                    $Customer_Address = $rowData[0][5]; }
&#13;
&#13;
&#13;

0 个答案:

没有答案