Rt
In doing a thing, you need to read the contents of the individual columns in Excel, the previous PHP Excelreader, but the merged cells are empty values, and my Excel is not good to judge as long as it is empty with the value of the previous array of the method, the Excel itself is more complex not too good to make changes, Is there any other class or method that can solve this problem?
Reply to discussion (solution)
Try this http://www.oschina.net/code/snippet_76782_1264.
That looks like I saw it. It is the operation of the cell merge when writing, it looks like the next assignment is to the merged cell write value, although not directly solve the problem, but I think if I can write, certainly corresponding should be able to read, I see if I can judge is the merged cell, and so on, first thank you ...
Can't read it directly ...
Finally can only use VBA to write the macro to separate the merged cells, and the values are restored, and then read in PHP ...
Think of a method: You can judge the value of the current cell to handle the line!
Find the empty value of the cell if it is a merged cell, the value is the value of the above or several columns. For example:
for ($i = 1; $i <= $data->sheets[0][' numrows '); $i + +) {
for ($j = 1; $j <= $data->sheets[0][' numcols '); $j + +) {
if (Trim ($data->sheets[0][' cells ' [$i] [$j]) = = "") {//is a merged cell with an empty value, more needs to be judged
for ($k = $i-1; $k >=0; $k-) {
if (Trim ($data->sheets[0][' cells ' [$k] [$j])! = "") {
$data->sheets[0][' cells ' [$i] [$j] = $data->sheets[0][' cells ' [$k] [$j];
Break
}
}
This can be further processed!
}
echo "\" ". $data->sheets[0][' cells ' [$i] [$j]." \",";
}
echo "
";
}