gk20 0 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? Link to post Share on other sites
kenrbnsn 2 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 Link to post Share on other sites
gk20 0 Posted March 8, 2006 Author Share Posted March 8, 2006 Cheers for that, worked perfectly!! Link to post Share on other sites
Recommended Posts
Archived
This topic is now archived and is closed to further replies.