title: Comparing 2 exact same strings returns false
body: <p>I have a variable that is posted through a html form:</p>
  
  <pre><code>$_POST['ref']
  </code></pre>
  
  <p>And a variable that is pulled from a table in a database:</p>
  
  <pre><code>$row['ref']
  </code></pre>
  
  <p>i have a basic comparison script to check if they are both the same:</p>
  
  <pre><code>$ref = $_POST['ref'];
  
  $result = mysql_query("SELECT * FROM logbook.job");
  if (!$result) {
      die("Query to show fields from table failed");
  }
  
  
      $row = mysql_fetch_array($result);
      $refdb = $row['ref'];
      $refform = $_POST['ref'];
  
      echo $_POST['ref'] ."&lt;br&gt;". $row['ref'] . "&lt;br&gt;&lt;br&gt;";
  
          if ($refdb == $refform) {
      echo "Yes they are&lt;br&gt;&lt;br&gt;";
      }
  
      else {
      echo "No they are not&lt;br&gt;&lt;br&gt;";
      }
  
  
      if (is_string($_POST['ref'])) 
   {
   echo "Yes";
   } else {
   echo "No";
   }
  echo "&lt;br&gt;";
      if (is_string($row['ref'])) 
   {
   echo "Yes";
   } else {
   echo "No";
   }
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>G2mtxW
  G2mtxW
  
  No they are not
  
  Yes
  Yes
  </code></pre>
  
  <p>I echo them both out. Than i ask if they are the same. Then i check whether each is a string.</p>
  
  <p>How come they are not the same? How can i get them to match</p>
  
  <p>Any help would be appreciated </p>