php-excel.class.php collect data foreach row -


https://code.google.com/p/php-excel/
i'm trying same numbers(for test purposes here) in 1 row:
in end desired result is:
h1 # h2 # h3
1 # 1 # 1
2 # 2 # 2
3 # 3 # 3

that's php looks , need output in form ($data) class understand (and in best case generate automatically/dynamically number of existing column-arrays ):

$head=array("h1","h2","h3"); $column1=array(); $column2=array(); $column3=array();  for($i=1;$i<=3;$i++){    $column1[]=$i;    $column2[]=$i;    $column3[]=$i; } 

expected php-example class don't know how generate:

$data = array(         1 => array ('name', 'surname'),         array('schwarz', 'oliver'),         array('test', 'peter')         );  // generate file (constructor parameters optional)     $xls = new excel_xml('utf-8', false, 'my test sheet');     $xls->addarray($data);     $xls->generatexml('my-test');     */  

nyos_excelwriter_simple 1.0 seems easier use , output more predictible:

// data array     $array = array();      // 1 string     $tr = array();         // 1 colum         $tr[] = 'one';         // 2 colum         $tr[] = 'two';      $array[] = $tr;      // 2 string     $tr = array();         // 1 colum         $tr[] = '2 one';         // 2 colum         $tr[] = '2 two';      $array[] = $tr;  

http://www.phpkode.com/source/s/nyos_excelwriter_simple/example.php
http://www.phpkode.com/source/s/nyos_excelwriter_simple/excel_simple.php


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

c# - Retrieve google contact -

javascript - How to insert selected radio button value into table cell -