Article from BadBlue Report ()
July 6, 2002
PHP developers: read an Excel spreadsheet with a single function call
Download BadBlue with ShareOffice free!

PHP ShareOffice is the easiest way to read Office files. The ShareOffice library lets you read or update Excel spreadsheets or read Access data. In fact, if BadBlue is running on several PC's or servers, your scripts can read the data from the remote machines too.

Here's an example of how easy it is to use. The following example reads an Excel spreadsheet (a rectangular set of cells, A1 through K35) and then displays the contents of two of the cells (A3 and D17):


    $arrayExcelData = array();
    $errmsg = SOExcel("127.0.0.1", "path3", "Invoices.xls", 1,
        $arrayExcelData, "A1", "K35");
    if (strlen($errmsg)) {
        echo("SOExcel Error: ".$errmsg);
    } else {
        echo("Cell  A3: ".$arrayExcelData["A3"]);
        echo("Cell D17: ".$arrayExcelData["D17"]);
    }

In a single function call, the PHP author can read an entire block of cells from a spreadsheet; update a spreadsheet; read an Access table or query; and capture an entire web page. By specifying the IP address of the PC running BadBlue, the author can read data from the local PC or even a remote machine (as long as the machine hosting the data is running a copy of BadBlue).

If you're looking for the easiest way to get to your Microsoft Office data using PHP, ShareOffice does the job - and you can try it out for free with BadBlue Personal Edition.

Read more about ShareOffice or download BadBlue Personal Edition 1.7.3 with ShareOffice included.


Published by BadBlue
Copyright © 2009 Working Resources, Inc.. All rights reserved.
Features subject to change. Use of software is subject to acceptance of terms and conditions of End User License Agreement (EULA).
Powered by IMN