How to create an Excel document using PHP and write variables to it?

    1 answer 1

    You can create an xml document as a plain text document by writing the necessary information into it:

    1. a template is made in Excel and saved in xml format;

    2. c using PHP (or javascript if necessary on one computer) opens as text and changes the content

    3. the finished text is written to the new file with the xml or xls extension

    • xls is a binary format. Did you try to open it "as a text" at all? - Sh4dow
    • if exel 2003 and older (understands xml), then the format does not matter. If you rename a file output from excel in xml format in xls, then the exel opens it as if you open this xml program with exel. And the content will contain a real spreadsheet with design, formulas, fonts, etc. - vv-d