Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9145937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:38:14+00:00 2026-06-17T10:38:14+00:00

I am using PHPExcel for the first time. I just wrote a basic code

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:38:15+00:00Added an answer on June 17, 2026 at 10:38 am

    That code is picking up on the HTML Reader, which still has some of my diagnostics in the code (mea culpa)… if you edit the file Classes/PHPExcel/Reader/HTML.php and comment out every line that contains an echo or a var_dump statement, then it should eliminate the problem.

    Coincidence that it’s something I was actually working on last night.

    Then you can also ask the person who provided you with the file to give you a proper .xls file in future, rather than one which has an extension of .xls but contains html markup rather than a properly formatted BIFF file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using PHPExcel library to read/write excel files. Now I want to generate
I want to read/retrieve an Image from excel file to PHP using PHPExcel. This
I'm using getCalculatedValue() in my PHPExcel to read 34 Excel files. Unfortunately there were
I'm using PHPExcel 1.7.8 to read .xls files, uploaded by a radom user. All
With one of my projects I have users 'export' information into Excel files using
Hi~ I am using PHPExcel 1.7.7 to read XLSX files and present the results
I am trying to read a number from an excelsheet using PHPExcel. The code
I am using PHPExcel to read data from Excel. It is not giving me
I'm using the PHPExcel library to read an Excel file and perform processing on
I am using phpexcel class to read .xls, .ods and .xlsx files, I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.