Preg_replace prices

I’m trying to filter the price line to make it readable. In its original form, it might look like this (without quotes): “2,200.00”
Help to make a regular season to get “2200”.
Tried like this:

$result = preg_replace("/([^0-9,]\s)/iu","", $result);

It doesn’t work.


Answer 1, authority 100%

If you want to get a float, then you can do this:

$result = (float)strtr($result, array(',' => '.', ' ' => ''));

If the whole is enough:

$result = (int)preg_replace('/[^\d,]/', '', result);

Answer 2

I solved it in the following way:

$result = preg_replace("/[,\s+]/iu","", $result);

It seems to work.