Update README.md

This commit is contained in:
Lico San
2019-08-12 22:20:29 +02:00
committed by GitHub
parent 7aa2fd10b1
commit 62bc72870e
+3 -3
View File
@@ -53,20 +53,20 @@ if($f1->parse_error=='') echo($f1->compute());
else echo($f1->parse_error."<br>\n"); // Too many closing parenthesis ! else echo($f1->parse_error."<br>\n"); // Too many closing parenthesis !
``` ```
**Use of a indexed array** **Using an indexed array**
```PHP ```PHP
$f1 = new Formula1('toto*primes[6]',['toto'=>10,'primes'=>[2,3,5,7,11,13,17,19,23,29,31]]); $f1 = new Formula1('toto*primes[6]',['toto'=>10,'primes'=>[2,3,5,7,11,13,17,19,23,29,31]]);
echo($f1->compute()."<br>\n"); //170 echo($f1->compute()."<br>\n"); //170
``` ```
**Use of a key-value array** **Using a key-value array**
```PHP ```PHP
$f1 = new Formula1('toto*myar["zorglub_99"]',['toto'=>10,'myar'=>['aaa'=>2.5,'zorglub_99'=>5.5]]); $f1 = new Formula1('toto*myar["zorglub_99"]',['toto'=>10,'myar'=>['aaa'=>2.5,'zorglub_99'=>5.5]]);
echo($f1->compute()."<br>\n"); //55 echo($f1->compute()."<br>\n"); //55
``` ```
**Use offunctions** **Using math functions**
```PHP ```PHP
$f1 = new Formula1('2*5+sin(pi()/4)'); $f1 = new Formula1('2*5+sin(pi()/4)');
echo($f1->compute()."<br>\n"); //7.071... echo($f1->compute()."<br>\n"); //7.071...