library calculater
Calculater library for php
know/calculater
Calculater library for php
- Wednesday, June 27, 2018
- by jianzhenchen
- Repository
- 2 Watchers
- 0 Stars
- 216 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 5 Versions
- 0 % Grown
Calculater
, (*1)
安装
composer require know/calculater
使用
<?php
use Know\Calculater\Calculater;
$params = [
1 => 1,
2 => 4,
3 => 6,
4 => 16,
5 => 100,
];
$calculater = new Calculater();
$string = '+ (1) (+ (1) (2))';
$result = $calculater->calculate($string, $params); // 6
$string = '++ 1 3';
$result = $calculater->calculate($string, $params); // 11
// 对应的选项
$extParams = [
1 => 0,
2 => 1,
3 => 1,
4 => 0,
5 => 2,
];
//(数字①-数字②)代表第①题的选项②(②从0开始,按顺序计。用户选此选项计单项分,未选不计)
$string = '+ (1) (+ (1-1) (2-1))'; // 1 + 0 + 4
$result = $calculater->calculate($string, $params, $extParams); // 5
dev-master
9999999-dev
Calculater library for php
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
1.0.4
1.0.4.0
Calculater library for php
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
1.0.3
1.0.3.0
Calculater library for php
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
1.0.2
1.0.2.0
Calculater library for php
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
1.0.1
1.0.1.0
Calculater library for php
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕