Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/05/2009, 08:59
bellleti
 
Fecha de Ingreso: abril-2008
Mensajes: 144
Antigüedad: 16 años, 11 meses
Puntos: 1
Pregunta creando excell desde php

buenas tengo unos archivos que me crean el xls con el siguiente codigo:



Código PHP:
ob_start(); 
echo 
"&nbsp;<center><table border=\"1\" align=\"center\">"
//echo "<tr>
//<td></td><td><font color=\"#000000\"><strong>informe sobre l'ultim control:</strong></font></td> 
//</tr>"; 
 

echo "<tr bgcolor=\"#336666\"> 
  <td><font color=\"#ffffff\"><strong>CODI</strong></font></td> 
  <TD><font color=\"#ffffff\"><strong>TESTDIM</strong></font></TD> 
  <td><font color=\"#ffffff\"><strong>LLET</strong></font></td> 
  <td><font color=\"#ffffff\"><strong>GRASA</strong></font></td>
  <td><font color=\"#ffffff\"><strong>CELULES</strong></font></td>
  <td><font color=\"#ffffff\"><strong>PROTEINES</strong></font></td>
  <td><font color=\"#ffffff\"><strong>LACTACIO</strong></font></td>
  <td><font color=\"#ffffff\"><strong>ULTIM PART</strong></font></td>
  
</tr>"

while(
$row=mysql_fetch_array($result)) 
{   
    echo 
"<tr>";   
     for(
$j=0$j<$campos$j++) {   
         echo 
"<td>".$row[$j]."</td>";   
     }   
     echo 
"</tr>";         
}   
echo 
"</table>"

$reporte ob_get_clean();
/******************************************** 
Set the automatic downloadn section 
/********************************************/

header("Content-type: application/vnd.ms-excel"); 
header("Content-Disposition: attachment; filename=informe-ultimcontrol-.xls"); 
header("Pragma: no-cache"); 
header("Expires: 0");  

echo 
$reporte
la question no es tècnica es màs bien... que me gustaria saber que tipo de libreria estoy utilizando.. que hace la funcion ob_start(); y estos header? y esto ya biene incorporado en php=?

en definitiva porque usamos esto, y de donde viene, tengo que explicarlo en un trabajo :P

gracias :P