承接 carriongrow/formula_parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

carriongrow/formula_parser

Composer 安装命令:

composer require carriongrow/formula_parser

包简介

Parses formulas, with the possibility of a deferred solution with substitution of user variables

README 文档

README

Parses formulas, with the possibility of a deferred solution with substitution of user variables

composer require carriongrow/formula_parser

Installation

$ composer require carriongrow/formula_parser

Description

Supported functions basic = '*', '/', '+', '-', '^' functional operations = 'cos', 'sin', 'exp', 'abs', 'log', 'sqrt', 'tan', 'pi'

cos sin tan - Do not require a transfer from degrees to the radian equivalent

Available symbols for dynamic variables: 0-9 a-z _ .or [a-z.0-9_] no dependence on the register!

Example

 $parser = new FormulaParser();
 $parser->setFormula('test1 * test2 * 2 (1 + 10) / 20'); // Parsing formulas once
 $counter = 1000;
 $result = [];
 while ($counter != 0) { // We use it as many times as we need
   $first = rand(1, getrandmax()) / getrandmax();
   $second = rand(1, getrandmax()) / getrandmax();
   $parser->setVariables(['test1' => $first, 'test2' => $second]); // Replacing user variables with values
   $result[] = $parser->calculate();
   $counter--;
 }

more look in tests - https://github.com/AnatolySnegovskiy/FormulaParser/blob/master/test/FormulaParserTest.php

统计信息

  • 总下载量: 104
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固