forked from MidnightLightning/php-excel-xml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
24 lines (22 loc) · 672 Bytes
/
Copy pathexample.php
File metadata and controls
24 lines (22 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require('php-excel-xml.php');
$e = new ExcelXML();
$e->setHeaders(array(
'test' => new ExcelHeader('Test'),
'foo' => new ExcelHeader('Foo Col', 'Number'),
'bar' => new ExcelHeader('Column Three'),
));
$e->addRow(array(
'test' => new ExcelCell('This is my test'),
'foo' => new ExcelCell('12'), // Note we're missing a third column here
));
$e->addRow(array(
'test' => new ExcelCell('Row 2', 'http://example.com'),
'bar' => new ExcelCell('Hi!'), // Note we skipped a column here
));
$e->addRow(array(
'test' => new ExcelCell('Row 3'),
'foo' => new ExcelCell(14, null, 'Not really sure on this one...'),
'bar' => new ExcelCell('Howdy!'),
));
echo $e->out();