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. 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); 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! Link to comment https://forums.phpfreaks.com/topic/274048-remove-commas-from-string/#findComment-1410176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.