Jump to content

Recommended Posts

Hey,

 

Im trying make a way to check an input to make sure it only consists of "1,2,3,4,5,6,7,8,9,0 and . " I thought i could explode the number and check it to an array that has "1,2,3,4,5,6,7,8,9,0 and . "

 

I havent worked with arrays before so i dont quite know how they work or to go about this?

 

Any ideas cause im sure im not the first to ask for something like this

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/249442-check-integer-explode-to-an-array/
Share on other sites

It depends what you want to do:

 

1. Do you want to control the user input and return a "yes" or "no" whether it contains forbidden characters?

2. Or do you want to remove all forbidden characters automatically without letting the user know?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.