Reputation: 1
i need to store in a variale the content of a cell area and after print the value.
The code that i use is:
$type=$objPHPExcel->getActiveSheet()->setAutoFilter('C4:E4');
echo $type;
but it doesn't work.How can i do?
Thanks
Upvotes: 0
Views: 528
Reputation: 212412
The setAutoFilter()
method is for setting an auto-filtering area in a worksheet, and returns the worksheet object (as shown in the API docs); and PHP's echo displays scalar values, not arrays or objects (unless the class has a __toString()
method, which the worksheet object does not).
If you need to display the contents of a range of cells, consider using the worksheet's rangeToArray()
method to return a 2-dimensional array of cells, and you can then loop through that displaying the values for each individual cell. Alternatively, there are various other methods shown in the /Examples
and /Documentation
to display data from cells.
Upvotes: 1