This will work for you:
$Anum="10";
$Bnum="30";
$MOD=">=";
eval("\$result = ($Anum $MOD $Bnum) ? true : false;");
if ($result) {
echo "$Anum is smaller than $Bnum";
} else {
echo "$Anum is not smaller than $Bnum";
}
Output:
10 is not smaller than 30
BUT.
PHP has variable variables and can expand strings into variables with it, but it does not work for language constructs, only for variables. ">=" is a comparison operator, so by this:
$Anum.$MOD.$Bnum
//or this
"$Anum $MOD $Bnum"
or this
"{$Anum} {$MOD} {$Bnum}"
You can only get a string, which will always give you true when using with if statement. To achieve what you want with your strategy you need to use eval. But it is a function, that should be avoided, unless you have enough experience and knowledge to use it with all responsibility and caution.