![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
21/09/2010, 16:26
|
![Avatar de Akiracr](http://static.forosdelweb.com/customavatars/avatar150470_1.gif) | | | Fecha de Ingreso: septiembre-2006
Mensajes: 114
Antigüedad: 18 años, 5 meses Puntos: 3 | |
Respuesta: Uso de Excel-Reader con archivo almacenado en variable Me parece que solo poniendo así sin comillas debe funcionar $data = new Spreadsheet_Excel_Reader($archivo);
yo uso esta librería en una clase de la siguiente forma:
function __construct(){
$this->data = new Spreadsheet_Excel_Reader();
$this->data->setOutputEncoding('CP1251');
}
function readLoad($fileName){
$retorno = null;
$this->data->read($fileName);
for ($i = 1; $i <= $this->data->sheets[0]['numRows']; $i++) {
$tmp = null;
for ($j = 1; $j <= $this->data->sheets[0]['numCols']; $j++) {
$tmp[] = $this->data->sheets[0]['cells'][$i][$j];
}
$retorno[] = $tmp;
}
return $retorno;
} |