Hi,
I need to strip out commas and full stops (periods) from a numeric value so that I can pass this to a payment gateway so I was wondering what you can suggest. Is there a specific ‘money’ type PHP script that would do this or is it just some other simple type of ‘strip’ that I can use?
For example I need 6,000.39 to end up like 600039
Thanks for any help
B
Stripping ',' and '.'
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Yep just did this and all lookin good!
Thanks
Code: Select all
$remove = array(",", ".");
$amount = str_replace($remove, "", "6,8000.00");
echo $amount ;