语言/方程式

v0.0.1 2024-08-14 12:44 UTC

This package is not auto-updated.

Last update: 2024-09-30 01:52:29 UTC


README

基于 bc_math 的 PHP 公式解析器

安装

$ composer install lang\equation

简单示例

<?php

use Lang\Equation\Equation;

$expr = Equation::parse('1+1');
echo $expr->getValue();
// Output: 2

// With params
// !notice parameter name format: ':param_name:'
$expr2 = Equation::parse('2 + :var:');
echo $expr2->getValue(['var' => 2]);
// Output: 4

许可证

MIT 许可证(© 2024 Lang)

享受使用 方程式 的乐趣