dmccabe Posted December 30, 2008 Share Posted December 30, 2008 I have a text field that contains a number eg 17,365 When I come to enter this in to the db it picks up the , (comma) as a separator. How can I get round this? I tried: $value = trim($value,","); with no luck? Quote Link to comment https://forums.phpfreaks.com/topic/138889-how-to-remove-a-comma-from-some-numbers/ Share on other sites More sharing options...
premiso Posted December 30, 2008 Share Posted December 30, 2008 str_replace Should do the trick. Quote Link to comment https://forums.phpfreaks.com/topic/138889-how-to-remove-a-comma-from-some-numbers/#findComment-726274 Share on other sites More sharing options...
dMilesFox Posted December 30, 2008 Share Posted December 30, 2008 Yeah, I second "premiso" option! Quote Link to comment https://forums.phpfreaks.com/topic/138889-how-to-remove-a-comma-from-some-numbers/#findComment-726278 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.