On 10/12/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
My take:

$number = (int) $number;
if ($number < 1) $number = 1;

You could error out for < 1, or compare the original with the (int)
cast  to see if PHP considers them = and error out if not, while using
the (int) cast to be SURE you have an int, or...

But a typecast and inequality test should be pretty clear and cheap.


Hey, nice. Thanks!

Dotan Cohen

http://what-is-what.com/what_is/bluetooth.html
http://lyricslist.com/lyrics/artist_albums/509/whitesnake.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to