Strings Php

   $pswd = "asdf1asdf";
   if (!eregi("^[a-zA-Z0-9]{8,10}$", $pswd)) 
   echo "password must consist of alphanumeric characters, and must be 8-10 characters in length!";
?>