
SPYRO KiD - 2011-05-08 09:15:21
Hi,
Your code is awsome ^_*
I'm using your code for my project, thank you very much :)
BTW, i need to display the worksheet name, so i add the following function into your class:
//$xlsx->getWorksheetName() - List All worksheet name
//$xlsx->getWorksheetName(1) - Get first Worksheet name
function getWorksheetName($dimId = 0){
$xmlWorkBook = simplexml_load_string( $this->getEntryData("xl/workbook.xml") );
if($dimId==0){
//Get All worksheet name
$worksheetName = "<ul>";
foreach ($xmlWorkBook->sheets->sheet as $sheetName) {
$worksheetName .= "<li>".$sheetName['name']."</li>";
}
$worksheetName .= "</ul>";
return $worksheetName;
}else{
//get worksheet name by id
return $xmlWorkBook->sheets->sheet[$dimId-1]->attributes()->name;
}
}
If you have a beter code, please add function to get Worksheet name into your class, maybe it will help someone.
Thank you :)