title: Compairing html string to hex string with php
body: <p>I am trying to compare two strings. When compared they are unequal to the computer. But to the human eye the strings appear to be the same. </p>
  
  <p>When I run a test to check the bin2hex with php they are clearly unequal. Some how a set of double quotes is be read as html. Here are some examples: </p>
  
  <pre><code> $string1 = strlen(html_entity_decode($_SESSION['pageTitleArray'][$b]));
   $string2 = strlen(html_entity_decode($value));
  
   echo 'Checking: ' . $_SESSION['pageTitleArray'][$b] . " " .  bin2hex($_SESSION['pageTitleArray'][$b]);
   echo '&lt;br&gt;';
   echo 'testing ' . $string1 . " = "bin2hex($string1) . " " . bin2hex($string2);
   echo '&lt;br&gt;';
   echo 'With: ' . $value . " " . bin2hex($value);
  </code></pre>
  
  <p>The code above will out put the following information. </p>
  
  <blockquote>
    <p>Checking: 1 PAIR OF BBC HEAD GASKET GASKETS MULTI LAYERED STEEL 4.585"
    312050414952204f46204242432048454144204741534b4554204741534b455453204d554c5449204c41594552454420535445454c20342e35383522
    testing 3630 3632 With: 1 PAIR OF BBC HEAD GASKET GASKETS MULTI
    LAYERED STEEL 4.585″
    312050414952204f46204242432048454144204741534b4554204741534b455453204d554c5449204c41594552454420535445454c20342e3538352623383234333b
    false</p>
  </blockquote>
  
  <p>I am kinda lost on what to do... Any help would be greatly appreciated. Below is the rest of the code so you can get a total feel for what I'm trying to accomplish. </p>
  
  <pre><code>     for($b = 0; $b &lt; count($_SESSION['pageTitleArray']); $b++)
   {
     foreach($_SESSION['pushIdArrayQuery'] as $key =&gt; $value)
     {
  
       $string1 = strlen(html_entity_decode($_SESSION['pageTitleArray'][$b]));
       $string2 = strlen(html_entity_decode($value));
  
       echo 'Checking: ' . $_SESSION['pageTitleArray'][$b] . " " .  bin2hex($_SESSION['pageTitleArray'][$b]);
       echo '&lt;br&gt;';
       echo 'testing ' . $string1 . " = "bin2hex($string1) . " " . bin2hex($string2);
       echo '&lt;br&gt;';
       echo 'With: ' . $value . " " . bin2hex($value);
  
       if(trim($_SESSION['pageTitleArray'][$b]) == trim($value))
       {
         echo '&lt;br&gt;';
         echo '&lt;h1&gt;Success&lt;/h1&gt;';
         echo '&lt;br&gt;';
         echo '&lt;b&gt;Key: &lt;/b&gt;' . $key;
         echo '&lt;br&gt;';
         echo 'Page Id: ' . $_SESSION['pushTitleArrayQuery'][$key];
         echo '&lt;br&gt; ';
       }
       else {
         echo '&lt;br&gt;';
         echo 'false';
         echo '&lt;br&gt;';
       }
     }
   }
  </code></pre>