title: Check string length in PHP
body: <p>I have a string that is 141 characters in length. Using the following code I have an <code>if</code> statement to return a message if the string is greater or less than 140.</p>
  
  <pre><code>libxml_use_internal_errors(TRUE);
  $dom = new DOMDocument();
  $dom-&gt;loadHTMLFile($source);
  $xml = simplexml_import_dom($dom);
  libxml_use_internal_errors(FALSE);
  $message = $xml-&gt;xpath("//div[@class='contest']");
  
  if (strlen($message) &lt; 141)
  {
     echo "There Are No Contests.";
  }
  elseif(strlen($message) &gt; 142)
  {
     echo "There is One Active Contest.";
  }
  </code></pre>
  
  <p>I used var_dump on $message and it shows the string is <code>[0]=&gt; string(141)</code>. Here is my problem: When I change the numbers for the <code>if</code> statement to <code>&lt;130</code> and <code>&gt;131</code>, it still returns the first message, although the string is greater than 131.</p>
  
  <p>No matter what number I use less than 141 I always get "There Are No Contests." returned to me.</p>