Checking if inputtext is text
#4

Add this anywhere in your script:

PHP код:
stock IsNumeric(const string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;

That's the "IsNumeric" function.

Now you can use it like this:

PHP код:
if(IsNumeric(inputtext)) return 1
That means if "inputtext" is numeric. If it is.
Reply


Messages In This Thread
Checking if inputtext is text - by Vanter - 17.08.2013, 17:31
Re: Checking if inputtext is text - by gtakillerIV - 17.08.2013, 17:36
Re: Checking if inputtext is text - by Vanter - 17.08.2013, 17:44
Re: Checking if inputtext is text - by gtakillerIV - 17.08.2013, 17:49
Re: Checking if inputtext is text - by Vanter - 17.08.2013, 19:13
Re: Checking if inputtext is text - by Vanter - 17.08.2013, 20:04
Re: Checking if inputtext is text - by Edix - 17.08.2013, 20:13
Re: Checking if inputtext is text - by Vanter - 17.08.2013, 20:24
Re: Checking if inputtext is text - by Vanter - 17.08.2013, 20:31

Forum Jump:


Users browsing this thread: 3 Guest(s)