I am trying to remove certain parts of my string using preg_match. I do not know if this is the best scenario.
I have the following string:
Uploaded Today 13:11, Size 117.09 MiB, ULed by demonoidt
I want to get only the 117.09 part of the string. I am using preg_match like this:
$res = preg_replace("/[^0-9]/", "", $string);
But this will return all the numbers found in the string, so I would have something like:
131111709
Any help would be greatly appreciated. Thank you and happy holidays.
$var = "117.09"This is obviously not what you meant, but i can think of any number of substring operations that would only work for this case. Could you clarify why you want that part?