17.08.2013, 17:49
Add this anywhere in your script:
That's the "IsNumeric" function.
Now you can use it like this:
That means if "inputtext" is numeric. If it is.
PHP код:
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
Now you can use it like this:
PHP код:
if(IsNumeric(inputtext)) return 1;