Hello,
I have a php variable that contains £123,456
How can I strip it down so it only has 123456 in the variable. The £ will always be at the beginning but the comma may well move.
Regards
Rowan Trimmer
$value = "£123,456"; echo ereg_replace("[^0-9]","",$value);
Might also consider just using str_replace(). Kind of the cheap way...
$string = "£123,298"; $string = str_replace(",", "", $string); $string = str_replace("£", "", $string);