Skip to content

Instantly share code, notes, and snippets.

@bvelastegui
Created May 4, 2017 16:15
Show Gist options
  • Save bvelastegui/52bc538dcf3dc2d439364bfad79e0da0 to your computer and use it in GitHub Desktop.
Save bvelastegui/52bc538dcf3dc2d439364bfad79e0da0 to your computer and use it in GitHub Desktop.
<?php
$xls = new Excel_Writer_Workbook('prueba.xls');
//creamos nuestro estilo para titulos
$h1 = $xls->addFormat(array(
'bold' => 1,
'size' => 8,
'fontFamily' => 'Tahoma',
'border' => 1,
'align' => 'center'
));
//creamos nuestro worksheet
$sheet = $xls->addWorksheet('Worksheet 1');
//Agregamos textos en A1 y B1 con el estilo ya definido en $h1
$sheet->write(0, 0, 'Prueba', $h1);
$sheet->write(0, 1, 'MatrixDevelopments', $h1);
//exportamos nuestro documento
$xls->close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment