I am using PHPExcel for the first time. I just wrote a basic code snippet to read one of my Excel files. I want to load the file, iterate through each row and process its contents. However, the function to load the file seems to dump its contents onto the screen.
My code snippet is this:
include 'lib/Classes/PHPExcel/IOFactory.php';
$dest = "uploads/";
$excel = "2012-12-STANDARD.xls";
$objPHPExcel = PHPExcel_IOFactory::load($dest.$excel);
On running this code, the data in the sheet has been echoed twice onto the screen. First, like a regular echo, and the second is a var_dump.
Here is a sample snippet of the screen output:
DOM ELEMENT: HTML DOM ELEMENT: BODY DOM ELEMENT: P START OF PARAGRAPH: END OF PARAGRAPH: FLUSH CELL: A1 => Type ZipCode City State County AreaCode CityType CityAliasAbbreviation CityAliasName Latitude Longitude TimeZone Elevation CountyFIPS DayLightSaving PreferredLastLineKey ClassificationCode MultiCounty StateFIPS CityStateKey CityAliasCode PrimaryRecord CityMixedCase CityAliasMixedCase StateANSI CountyANSI FacilityCode CityDeliveryIndicator CarrierRouteRateSortation FinanceNumber UniqueZIPName D 18540 ......
array 1 => array 'A' => string 'Type ZipCode City State County AreaCode CityType CityAliasAbbreviation CityAliasName Latitude Longitude TimeZone Elevation CountyFIPS DayLightSaving PreferredLastLineKey ClassificationCode MultiCounty StateFIPS CityStateKey CityAliasCode ........'... (length=4573)
Am I doing something wrong here? Why would the load function echo the contents before accessing it?