1. Go to this page and download the library: Download rizalmf/deductive-formula library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rizalmf / deductive-formula example snippets
use rizalmf\formula\DeductiveFormula;
use rizalmf\formula\exception\FormulaException;
// ...
// 1. define value per variable
$formula->setVariable("foo", 4);
$formula->setVariable("bar", 1);
// 2. use array
$formula->setVariables([
"foo" => 4,
"bar" => 1
]);
// ...
// 1. get value from specific variable
var_dump($formula->getVariable("foo"));
// output : 4
// 2. get values all variables
var_dump($formula->getVariables());
// output : array ([foo] => 4, [bar] => 1)
// 1. get possible variables from Formula
var_dump($formula->getRequestedVariables());
// output : array ([0] => "foo", [1] => "bar")