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 7129865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:17:19+00:00 2026-05-28T11:17:19+00:00

For CSV is: <?php $row = 1; if (($handle = fopen(test.csv, r)) !== FALSE)

  • 0

For CSV is:

<?php
$row = 1;
if (($handle = fopen("test.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $num = count($data);
        echo "<p> $num fields in line $row: <br /></p>\n";
        $row++;
        for ($c=0; $c < $num; $c++) {
            echo $data[$c] . "<br />\n";
        }
    }
    fclose($handle);
}
?>

For XML:

<?php
// The file test.xml contains an XML document with a root element
// and at least an element /[root]/title.

if (file_exists('test.xml')) {
    $xml = simplexml_load_file('test.xml');

    print_r($xml);
} else {
    exit('Failed to open test.xml.');
}
?>

This is very simple way to parsing. Is possible this also with EXCEL? I dont want use excel readers etc. I would like simple parser, same as for xml or csv.
How is the best way for this? Maybe parse excel to csv or xml, but how?

  • 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-05-28T11:17:20+00:00Added an answer on May 28, 2026 at 11:17 am

    There is no one Excel format… there are two common formats: BIFF .xls files (used up to Excel 2003) and OfficeOpenXML .xlsx files (for both Excel 2007 and Excel 2010), not to mention SpreadsheetML, the rarely-used alternative format for Excel 2003. Nor are these formats simple like CSV or even “vanilla” XML: even the OfficeOpenXML format comprises a whole series of interrelated XML files in a zipped directory hierarchy.

    Then, you can also factor in the formatting and other facilities that are pesent in a spreadsheet file (multiple worksheets, hidden/merged columns/rows, styling, images, charts, etc. This also means that it is not a trivial task to parse the files and present them in a simple manner.

    There are a number of PHP libraries (and other alternatives) available for accessing spreadsheet data and/or for creating/editing spreadsheet files from within PHP. I’m responsible for the development of one of those libraries (PHPExcel), and have compiled a list of the alternatives in answer to previous questions here on StackOverflow.

    If you only want to read spreadsheet data, then select one of the readers from the list: if you want to create new spreadsheets, then pick a writer. If you want to edit existing workbooks, then you really need one of the few libraries/options that supports both reading and writing.
    And watch out for the supported file formats… not all libraries support both BIFF .xls and .xlsx.

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

Sidebar

Related Questions

I have this PHP: $handle = fopen($_FILES[csvfile][tmp_name], r); while (($data = fgetcsv($handle, 5000, ,,
I am programmatically exporting data (using PHP 5.2) into a .csv test file. Example
Using PHP, I can convert MySQL data or static table data to csv, Excel,
I'm creating Excel files in a PHP project. Those files aren't just CSV data...
I read in a csv file by using a while loop: while (($data =
I am using PHP to expose vehicle GPS data from a CSV file. This
I want to convert my sql data to csv files while clicking on a
fegtcsv does the work for fetching data of csv file in php I wrote
Need to process large csv files with php. Working with fgetcsv and performance seems
I have a PHP app that creates a CSV file which is forced to

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.