Contenu du fichier de /php-excel-xml/exemple.php (télécharger exemple.php)
<?php
include("class.php-excel-xml.php");
$doc= new Excel(9);
$doc->add_title("My Title");
$doc->add_texto("test");
// Open table with sub title
$doc->open_container("sub title");
$doc->add_header(Array("first", "second", "third"));
for($i=0;$i<10;$i++)
{
$doc->add_line(Array(rand(1,10), rand(1,10), rand(1,10)));
}
$doc->close_container();
// Open table without subtitle
$doc->add_header(Array("first", "second", "third"));
for($i=0;$i<10;$i++)
{
$doc->add_line(Array(rand(1,10), rand(1,10), rand(1,10)));
}
echo $doc->output();
?>