Jump to content

Check integer explode to an array?


UrbanDweller

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?

Archived

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

×
×
  • 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.