//Procedural Works!!
$x=0;
$e1=$x/450+1/2; $e2=$x==0?false:6300/$x;
while($e1 !== $e2){
++$x;
$e1=$x/450+1/2; $e2=$x==0?false:6300/$x;
if($e1 == $e2){
echo "x Solution: ". $x . "<br>y Solution: ".$e1;
exit;
}
}
//Function fails on e2 WHY????? I'm done banging my head against the wall on this. I have researched eval but I don't know why e2 fails....
function eSolver($eq1,$eq2){
$x=0;
$e1=eval("return $eq1;"); $e2=eval("return $eq2;");
/*
while($e1 !== $e2){
++$x;
$e1=$eq1; $e2=$eq2;
if($e1 == $e2){
$ePoint= "x Solution: ". $x . "<br>y Solution: ".$e1;
exit;
}
}
*/
return $e2;
}
$supply=$x/450+1/2; $demand=$x==0?false:6300/$x;
echo eSolver($supply,$demand);
//e1 works not e2 and if e2 does not work, the whole function is pointless.