private function analyse_expression($data, $isPrintRepeatedValue = "true") { $arrdata = explode("+", $data); $i = 0; foreach ($arrdata as $num => $out) { $i++; $arrdata[$num] = str_replace('"', "", $out); if (substr($out, 0, 3) == '$F{') { if ($isPrintRepeatedValue == "true" || $isPrintRepeatedValue == "") { $arrdata[$num] = $this->data[$this->global_pointer][substr($out, 3, -1)]; } else { if ($this->previousarraydata[$arrdata[$num]] == $this->data[$this->global_pointer][substr($out, 3, -1)]) { $arrdata[$num] = ""; } else { $arrdata[$num] = $this->data[$this->global_pointer][substr($out, 3, -1)]; $this->previousarraydata[$out] = $this->data[$this->global_pointer][substr($out, 3, -1)]; } } } elseif (substr($out, 0, 3) == '$V{') { $arrdata[$num] =& $this->RParser->variables[substr($out, 3, -1)]["ans"]; } elseif (substr($out, 0, 3) == '$P{') { $arrdata[$num] = $this->RParser->parameters[substr($out, 3, -1)]; } } if (IReportHelper::left($data, 3) == '"("' && IReportHelper::right($data, 3) == '")"') { $total = 0; foreach ($arrdata as $num => $out) { if ($num > 0 && $num < $i) { $total += $out; } } return $total; } else { return implode($arrdata); } }