Jump to content

Find whether an int is positive or negative


ballhogjoni

Recommended Posts

That doesn't exactly account for if $int doesn't exist, though.  If $int doesn't exist, it will evaluate true, or 0, and echo "pos".  You'd have to wrap an if ($int) or if (isset($int)) or something around that.

 

edited for clarification.  I posted an example similar to darkwater's and based my explanation off it.  But since he posted an example, I changed it to base it off of his example.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.