[thelist] PHP - strings and integers

Lachlan Cannon luminosity at members.evolt.org
Tue Apr 9 00:30:01 CDT 2002


**1st Vamp** said:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: MD5
>
> You could always perform a reversable substraction or some on it, like:
> $num++;
> $num--;
> If the contents of the variable are numerical this will result in a
> numerical check after this point returning true, while if its a string
> it'll return false. I'm sure there's an easier method, but this
> works for me usually.
>
> - - Vamp


But if there's a number at the start of the string, on the reversable
subtraction, it gets cut to nothing but the number, which means I don't know
whether it was valid or not.

Lach





More information about the thelist mailing list