title: PHP compare strings error
body: <p>I am a beginner in PHP and I am trying to separate the input based on the argument. Following is my code but it seems that my <code>$arg</code> variables is never set. Can someone point out my error?</p>
  
  <pre><code>    $sender = $_GET['sender'];
      $receiver = $_GET['receiver'];
      $message = $_GET['message'];
      $temp = explode( '.', $message);
      $tempcnt = count($temp);
      echo $temp[$tempcnt - 1];
      if($tempcnt &gt; 2)
      {
          if($temp[$tempcnt-1] === 'mp4')
              {$arg = 3;}
          elseif($temp[$tempcnt-1]==='jpg')
              {$arg = 2;}
          else
              {$arg = 1;}
      }
      echo "Value of arg is" . $arg;
  </code></pre>
  
  <p>I have even tried with <code>==</code> and <code>===</code> and <code>strcmp</code> in <code>if</code> but still same issue.</p>