Jump to content

Archived

This topic is now archived and is closed to further replies.

gk20

accepting an "int" from a form?

Recommended Posts

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 code
and number that it will work?
For example if user enters 0095 123456 instead of just 0095123456? How will this work?

Share this post


Link to post
Share on other sites
You could use the str_replace() function to get rid of the space:
[code]</php $var = str_replace(' ','',$_POST['phone']); ?>[/code]

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.