Sign of a number

Is there such a PHP command that takes the sign of a number?

sign(-5) = -1
sign(5) = 1
sign(-2) = -1
sign(0) = 0

Nope, simply check if less than 0:


$var = -123;
if( $var < 0){
echo "it is negative";
}