PHP/HTML - Export to Excel

Discussion in 'PHP' started by koolsamule, Nov 10, 2009.

  1. #1
    Hi Chaps,

    I have a HTML table, and need to export the contents, with formatting to MS Excel.

    Does anyone know of a simple way to do this?
     
    koolsamule, Nov 10, 2009 IP
  2. aqgiles

    aqgiles Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not sure I understand you. Do you need to do this programmatically for visitors of a website that you own? Or do you just have a table that you want to capture/put data into Excel for yourself.

    If it's the latter (that's how I read your post, anyway), try this FF add-on: https://addons.mozilla.org/en-US/firefox/addon/7271
     
    aqgiles, Nov 10, 2009 IP
  3. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    just use fopen and name it something.csv
    
    $data = 'd1'.','.'d2'."\n"
    $fileConn = fopen($excel_file,"a");
    fwrite($fileConn, $data);	
    
    Code (markup):
     
    javaongsan, Nov 11, 2009 IP