|
[PHP]
function ReadExcelSheet($filename){
$test = file($filename);
$ar1 = str_replace("~[^\t]*\t", "\t", $test);
$ar2 = str_replace("~", "", $ar1);
$ar = str_replace(chr(179), "", $ar2);
$temp = array();
for ($i=0; $i < count($ar); $i++) {
if ((substr($ar[$i], 0, 1) != "\t")) {
if ($ar[$i] !== "\r\n") {
array_push($temp,$ar[$i]);
}
}
}
$name = split("\t",$temp[0]);
$ExcelList = array();
for ($i=1; $i < count($temp); $i++) {
$split_result = split("\t", $temp[$i]);
array_push($ExcelList, $split_result);
}
$result = insert_into_array($ExcelList, 0, $name);
return($result);
}[/PHP] |
|