I agree 100% with @requinix about setting the type of the field to a numeric input. However, I am a belt and suspenders type of programmer. UI constraints are great for helping the user to avoid common data entry errors, but I believe all such validations should have server-side controls (what if the user POSTed a form outside the UI?).
The problem is you are making the problem harder than it needs to be. Why do you only care about '£' character? Just because you are accidentally copy/pasting that character doesn't mean you wouldn't have issues with other characters. So, rather than trying to exclude only that specific, arbitrary character - you should remove all characters that would create an invalid number. Or, conversely, you could detect that the value is not a valid number and return the user back to the input page showing an appropriate error. The choice would be a business decision.
Taking the first approach, here is one way to do it:
function forceToNumber($value)
{
//Remove everything that is not a digit or decimal point
$value = preg_replace('/[^\d.]/', '', $value);
//Check if there is more than one decimal point
if(substr_count($value, '.') > 1)
{
//Remove everything from the 2nd decimal
$value = substr($value, 0, strpos($value, '.', strpos($value, '.')+1));
}
//Retur4n value as a float
return (float) $value;
}
I'm sure there is a more elegant way to deal with possible multiple decimal points (possibly with a single regex), but I've not worked with Regex for quite a while.