That'll work if the user always appends a ",00"; otherwise your script would say that 9,50 is greater than 900.
If you know that a period is always going to be used to group every third decimal location (e.g. the way a comma is used in American monetary notation), then you could try something like:
if(str_replace(array(',','.'),array('.',''),$price1) > str_replace(array(',','.'),array('.',''),$price2)) {
// $price1 bigger
} elseif (str_replace(array(',','.'),array('.',''),$price1) < str_replace(array(',','.'),array('.',''),$price2)) {
// $price 2 bigger
} else {
// same price
}