I am trying to detect if a users password is less than or equal to 5 characters then to error the user otherwise continue..

<?
$pass = $_POST[password];
if($pass <=5){
echo"Error";
}else{
echo"YAY no errors!";
}
?>

I can't get it to work can anyone point out a way to detect this xD

Any help is much appreciated!