gk20 Posted March 8, 2006 Share Posted March 8, 2006 I'm accepting a variable from a user in a form called phonenum that is of type INT my database.I want to make it work so that if the user enters a space in between numbers e.g. between area codeand number that it will work?For example if user enters 0095 123456 instead of just 0095123456? How will this work? Quote Link to comment https://forums.phpfreaks.com/topic/4441-accepting-an-int-from-a-form/ Share on other sites More sharing options...
kenrbnsn Posted March 8, 2006 Share Posted March 8, 2006 You could use the str_replace() function to get rid of the space:[code]</php $var = str_replace(' ','',$_POST['phone']); ?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/4441-accepting-an-int-from-a-form/#findComment-15420 Share on other sites More sharing options...
gk20 Posted March 8, 2006 Author Share Posted March 8, 2006 Cheers for that, worked perfectly!! Quote Link to comment https://forums.phpfreaks.com/topic/4441-accepting-an-int-from-a-form/#findComment-15428 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.