Re: [PHP] variable type - conversion/checking

[email protected] (Andrew Ballard)
Newsgroups php.general
Message-ID <CAC1b6RuA5nAODoL8JOwFOk1nkCA0++cUcaKy9Av3t3gRMXQwtg@mail.gmail.com>
> Guess regex are the only useful solution here. When you consider to use
> built-in functions, just remember, that for example '0xAF' is an integer
> too, but '42.00' isn't.

Shoot...I hadn't considered how PHP might handle hex or octal strings when
casting to int. (Again, not in front of a computer where I can test it
right now. )

Regexes have problems with more than 9 digits for 32-bit ints. I guess to
some degree it depends on how likely you are to experience values that
large.

Andrew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.