Location: PHPKode > scripts > Boolean Minimization > boolean-minimization/index.php
<?php
/*
* Author: Armin Randjbar-Daemi
* Demo: http://www.omnistream.co.uk/minimization/
*/
if (!empty($_POST['vari'])&&!empty($_POST['minterm'])&&$_POST['vari']<"12"&&strlen($_POST['minterm'])<"100")
    {
        $vari=addslashes(trim($_POST['vari']));
        $minterm=addslashes(trim($_POST['minterm']));

        include("./Minimization.class.php");
        include("./Chronometer.php");
        $chrono = new Chronometer();
        $chrono->start();
            $Minimization=new Minimization($vari,$minterm);
        $chrono->stop();
            
            for($p=0;$p<count($Minimization->PrimeImplicants);$p++)
                echo $Minimization->PrimeImplicants[$p]."<br />";//show final result
                
        echo "<font color=\"#c30606\">execution&nbsp;time:&nbsp;".$chrono->show()."&nbsp;&#956;s</font>";
    }
?>
<br /><br />
<form action="index.php" method="post">
<br />Minterms: <input type="text" name="minterm" />
<br />Variables: <input type="text" name="vari" />
<br /><input type="submit" value="ok" name="ok" />
</form>
Return current item: Boolean Minimization