ho risolto cosi:
codice:
include 'excel_reader.php';
$Pexcel = new PhpExcelReader;
$Pexcel->read('test.xls');
function sheetData($Pcalc) {
$Px = 1;
$Py = 4;
$Pcell = isset($Pcalc['cells'][$Px][$Py]) ? $Pcalc['cells'][$Px][$Py] : '';
return $Pcell;
}
$nr_P = count($Pexcel->sheets);
for($i=0; $i<$nr_P; $i++) {
$P = sheetData($Pexcel->sheets[$i]);
}
echo 'P= ';
echo $P;
dove px è la colonna e px è la riga e così come la battaglia navale recupero il valore di quella cella
ora però dovrei prenderne anche altri nello stesso foglio ma se replico la funzione mi va in errore la pagina es così:
codice:
<?php
include 'excel_reader.php';
$Pexcel = new PhpExcelReader;
$Pexcel->read('test.xls');
function sheetData($Pcalc) {
$Px = 1;
$Py = 4;
$Pcell = isset($Pcalc['cells'][$Px][$Py]) ? $Pcalc['cells'][$Px][$Py] : '';
return $Pcell;
}
$nr_P = count($Pexcel->sheets);
for($i=0; $i<$nr_P; $i++) {
$P = sheetData($Pexcel->sheets[$i]);
}
echo 'P= ';
echo $P;
$Lexcel->read('test.xls');
function sheetData($Lcalc) {
$Lx = 1;
$Ly = 4;
$Lcell = isset($Lcalc['cells'][$Lx][$Ly]) ? $Lcalc['cells'][$Lx][$Ly] : '';
return $Lcell;
}
$nr_L = count($Lexcel->sheets);
for($i=0; $i<$nr_L; $i++) {
$L = sheetData($Lexcel->sheets[$i]);
}
echo 'L= ';
echo $L;
?>
cosa sbaglio?? grazie mille