dreampho Posted February 5, 2013 Share Posted February 5, 2013 Hi. I am currently removing the currency symbol from my string, which is in this case 'R'. I want to also remove any commas, how can I do this? $deposit = str_replace('R','',$deposit); Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/274048-remove-commas-from-string/ Share on other sites More sharing options...
kicken Posted February 5, 2013 Share Posted February 5, 2013 You can pass an array of values to str_replace and it will replace each one str_replace(array('R', ','), '', $deposit); Quote Link to comment https://forums.phpfreaks.com/topic/274048-remove-commas-from-string/#findComment-1410173 Share on other sites More sharing options...
dreampho Posted February 5, 2013 Author Share Posted February 5, 2013 Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/274048-remove-commas-from-string/#findComment-1410176 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.