You are here

public function PHPExcel_Calculation::parseFormula in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php \PHPExcel_Calculation::parseFormula()

* Validate and parse a formula string * *

Parameters

string $formula Formula to parse: * @return array * @throws PHPExcel_Calculation_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php, line 2301

Class

PHPExcel_Calculation
PHPExcel_Calculation (Multiton)

Code

public function parseFormula($formula) {

  //	Basic validation that this is indeed a formula
  //	We return an empty array if not
  $formula = trim($formula);
  if (!isset($formula[0]) || $formula[0] != '=') {
    return array();
  }
  $formula = ltrim(substr($formula, 1));
  if (!isset($formula[0])) {
    return array();
  }

  //	Parse the formula and return the token stack
  return $this
    ->_parseFormula($formula);
}