title: Function to check if string length in greater than or less than required amount
body: <p>I want to create a function to check if the length of a string is greater than or less than a required amount:</p>
  
  <p>Something like this:</p>
  
  <pre><code>function check_string_lenght($string, $min, $max)
  {
   if ($string == "")
   {
     return x;   
   }
   elseif (strlen($string) &gt; $max)
   {
     return y;
   } 
   elseif (strlen($string) &lt; $min)
   {
     return z;
   }
   else
   {
     return $string;
   }
  
  }
  </code></pre>
  
  <p>The problem is I don't know what to return. I don't want to return something like 'String is too short'. Maybe a number, <code>0</code> <code>if == ""</code>, <code>1</code> if greater than, <code>2</code> if less than?</p>
  
  <p>What would be the proper way of doing this?</p>