I have a string which contains some of the following characters (comma is used as OR):
$car = (=, !=, <, <=. >, =>)
"string $car secondpart"
How can I see which character is used, adn take it in the new variable?
I have a string which contains some of the following characters (comma is used as OR):
$car = (=, !=, <, <=. >, =>)
"string $car secondpart"
How can I see which character is used, adn take it in the new variable?
You can use this regex:
if (preg_match('/([!<]=|=>?|[<>])/', $car, $m))
echo $m[1];
$m[1]
will contain one of those string you're looking for.