0

like in the title when i read an excel file i want to know if cell contain a value or a function. Is there a bool return method in PHPExcel like this?

$cell->getValue()->isFunction();

Thanks for the answers.

Alberto Favaro
  • 1,824
  • 3
  • 21
  • 46

1 Answers1

4

Not for the value, that wouldn't be possible because the value of a cell is a PHP scalar datatype, like boolean or string or float, so it can't have methods.

But you can tell if a cell contains a formula by calling the cell's isFormula() method, which returns a boolean true/false

$cell->isFormula();
Mark Baker
  • 209,507
  • 32
  • 346
  • 385