I am writing a class to handle some MySql functions.
For now, I want a regular expression pattern to detect operations.
Please see my code:
$a = "user_id <> 2";
$generalOperators = "/[<>|[<][\sA-Za-z0-9]|>|<|=]([\sA-Za-z0-9])/";
$op = "$1";
$asd = preg_replace($generalOperators, $op, $a);
echo $asd;
This will echo user_id 2 as output!
I am new to regular expressions.
Thanks in advance!