www.webdeveloper.com
Results 1 to 3 of 3

Thread: Is it possible to read directly from an Excel file using PHP on a webpage?

  1. #1
    Join Date
    Jun 2005
    Posts
    42

    Is it possible to read directly from an Excel file using PHP on a webpage?

    I finally got my site converted to PHP! Now I need to find out if it's possible to read variables directly from an Excel file and plug them into the web pages. The site gets price changes periodically from several manufacturers in either Excel spreadsheets or .csv files.

    I understand I could install and learn MYSQL, then update the database from the appropriate Excel file. If I have to do this manually, I might as well manually update the web pages directly (which is what I do now).

    I also gather from some of the postings here that it's possible to use PHP to retrieve the rows from the Excel file to update the database, so it seems logical I could also retrieve the values directly from the Excel file using PHP in the webpage. However, I have not been able to find anything about this in my PHP manuals or the forums.

    Can anyone help me with this?

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,241
    If you save the spreadsheet as a CSV file, it's pretty easy to read data via the fgetcsv() function.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jun 2005
    Posts
    42
    Aha! I should have been searching for csv instead of Excel. I'm still learning PHP, one thing at a time, but it's tough when I don't know what term to look for.

    Thank you!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles