Paste the code:
<?PHPerror_reporting(E_all& ~E_notice); $expression=$_get[' truetable '];//reading input box data if(!Empty($_get[' Truetable '])){ $expression=Strtoupper($expression);//Replace the lowercase letter entered with an uppercase letter $EXPRESSIONARR=Str_split($expression);//convert $expression to an array foreach($EXPRESSIONARR as $v){//Put the letters in the $varTotal array if($v>= ' A ' &&$v<= ' Z '){ $varTotal[]=$v; } } $varTotal=Array_unique($varTotal);//remove repeated letters from the $vartotal array Sort($varTotal);//alphabetical Ordering of $varTotal arrays $varTotal 1=Preg_replace("/([A-z])/", "$\\1",$varTotal);//$varTotal 1 The letters in the array become variables $maxN=Count($varTotal); //$EXPRESSIONARR = Preg_replace ("/([A-z])/", "$\\1", $EXPRESSIONARR);//$EXPRESSIONARR The letters in the array become variables $newExpression=implode(‘‘,$EXPRESSIONARR);//$expressionArr array becomes a string//echo $newExpression. " <br/> "; $newExpression=Preg_replace("/([A-z])-([A-z])/", "!\\1|\\2",$newExpression); $newExpression=Preg_replace("/(\ (. *?\))-([A-z])/", "!\\1|\\2",$newExpression); $newExpression=Preg_replace("/(\ (. *?\)), (. *?) /","!\\1|\\2 ",$newExpression); $newExpression=Preg_replace("/([A-z]), (. *?) /","!\\1|\\2 ",$newExpression); $EXPRESSIONARR=Str_split($newExpression);//convert $expression to an array $EXPRESSIONARR=Preg_replace("/([A-z])/", "$\\1",$EXPRESSIONARR); $newExpression=implode(‘‘,$EXPRESSIONARR); //echo $newExpression; }? ><! DOCTYPE html>$_get[' truetable ']?> "/> <input type=" Submit "value=" OK "/> <br/> <br/> &L t;! --<input type= "reset" value= "Cancel"/><br/><br/> <input type= "button" value= "∨"/> <input type= "button" value= "∧"/> <input type= "button" value= "┐"/> <input type = "button" value= "→"/> <input type= "button" value= "↔"/><br/><br/>--> </for m> <!--[Description: Disjunction (∨), Hop (∧), non (┐), implication (→), equivalence (↔)]--> <p>[Description: Disjunction (|), collection (&), non (!), implication (- >), equivalent (=)]</p> <table width= "300px" style= "margin:30px auto 0 auto;text-align:center;border:1px s Olid #000; " > <?PHPEcho"<tr>"; if(!Empty($_get[' Truetable '])){ foreach($varTotal as $v){ Echo"<td>{$v}</td> "; } Echo"<td> Results </td>"; $result=POW(2,$maxN); for($i= 0;$i<$result;$i++){ $resultN[$i]=sprintf("%0{$maxN}d ",Decbin($i)); $resultN[$i]=Str_split($resultN[$i]); } foreach($resultN as $k=$v){ Echo"<tr>"; foreach($resultN[$k] as $k 1=$v 1){ Echo"<td>".$v 1." </td> "; $varTotal 2[$k 1]=$varTotal 1[$k 1]." =".$v 1; //echo $varTotal 2[$k 1]. " "; Eval($varTotal 2[$k 1].";"); } //echo $newExpression; Eval("\ $varTotal 3[] =".$newExpression.";"); foreach($varTotal 3 as $k 2=$v){ if($v==NULL){ $varTotal 3[$k 2]=0; } } Echo"<td>".$varTotal 3[$k]." </td> "; Echo"</tr>"; } //Print_r ($varTotal 3); } ?> </table> </div> </body>PHP version of the Truth-table-truevaluetable expression