I have this string and need to get the number (integer or double) out of it.
String 1 GMT +2
String 2 - GMT +2.5
I have used this to get the integer out of String 1 and need to know how to write a generic one to get 2 or 2.5
below is what i have written.
return preg_replace('/\D/', '', $str);
but it doesnt return 2.5 but takes it as 25 instead of 2.5