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

  • SEARCH
  • Home
  • 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 8381193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:38:32+00:00 2026-06-09T16:38:32+00:00

I have encountered weird behavior of PHPExcel lib (I have never used it before).

  • 0

I have encountered weird behavior of PHPExcel lib (I have never used it before). I have code like this:

$inputFileName = 'excel.ods';
echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);

I dont know what exactly toArray method does because I CAN’T FIND ANY DOCUMENTATION OF THIS THING. I think that the problem occurs when an excel file has some blank cells – they are not copied but next cell is wriiten in their places or something. Could someone provide me documentation to function toArray? (i think that something is wrong with that parameters).

Thank you in advance 🙂

PS: it is code from example

  • 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-09T16:38:33+00:00Added an answer on June 9, 2026 at 4:38 pm

    toArray() takes the data from each cell in the worksheet and puts it in a PHP array

    /**
     * Create array from worksheet
     *
     * @param    mixed      $nullValue            Value returned in the array entry
     *                                            if a cell doesn't exist
     * @param    boolean    $calculateFormulas    Should formulas be calculated?
     * @param    boolean    $formatData           Should formatting be applied to cell
     *                                            values?
     * @param    boolean    $returnCellRef        False - Return a simple array of
     *                                            rows and columns indexed by number
     *                                            counting from zero
     *                                            True - Return rows and columns
     *                                            indexed by their actual row and
     *                                            column IDs
     * @return array
     */
    

    The documentation for PHPExcel is in the folder /Documentation.
    API docs are in /Documentation/API
    Examples are in the folders /Tests and /Documentation/Examples

    There is a bug in the current 1.7.7 release that can misalign cells read from ods files when there are blank cells in the worksheet. This bug has been fixed in the latest code on github.

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

Sidebar

Related Questions

I have encountered a weird situation while updating/upgrading some legacy code. I have a
Okay, so this is really werid. I've never encountered anything like this. Part of
I have this weird situation that i have encountered for the first time and
I have encountered a very weird behavior while using SimpleDateFormat for parsing a string
I have encountered a weird problem, when i built my last ad-hoc version for
I have encountered a very weird situation in Python. I have a while True:
I'm using VS10 and C# and I've encountered a weird problem. I have 2
I am newbie to ajax here and I know somebody would have encountered this
I encountered a weird problem setting a custom date format with PHPExcel: I'm writing
This is weird. I have a virtual directory setup for an MVC3 application called

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.