The value itself has a symbol, how to integrate into if

$a = "> = 2";
$baked 0;
if ($b $a) {
}
how to write the code to get Boolean 0 > = 2 = > false

Php
Apr.01,2021

you can use eval, but there are security risks. The following processing methods are recommended

$a = '>=2';
$b = 0;
if (strpos($a, '>=') !== false) {
    $a = str_replace('>=','',$a);
    var_dump('>=', $b >= $a);
} elseif (strpos($a, '>') !== false) {
    $a = str_replace('>','',$a);;
    var_dump('>', $b > $a);
}
// ...
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f9c8-40a34.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f9c8-40a34.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?