If I have a string "aGhcc123.4", how can I use php to separate the string into "aGhcc" and "123.4". Some strings have numbers in them and some don't.
Are the numbers always at the end of the string, or can they be in the middle or the start? Can there be more than one set of numbers in a single string?
This time the numbers are at the end of the string, and it's usually only one set of numbers with non-separated integers.
One possibility (untested):
$number = preg_replace('/\D*(\d+(\.\d+)?)/', "$1", $string);