title: Error in PHP code unexpected "$agent"
body: <p>I am getting the following error </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected '$agent' (T_VARIABLE) in
    C:\xampp\htdocs\webconcept2.php on line 3</p>
  </blockquote>
  
  <p>and the code is given below.
  I have checked all possible errors of semicolons etc but does not find the error     </p>
  
  <pre><code>&lt;?php
  
   $agent = $_SERVER['HTTP_USER_AGENT'];
  
  if(preg_match('/Linux/i',$agent)) $os = 'Linux';
    elseif(preg_match('/Mac/i',$agent)) $os = '/Mac';
    elseif(preg_match('/iPhone/i',$agent)) $os = 'iPhone';
    elseif(preg_match('/iPad/i',$agent)) $os = 'iPad';
    elseif(preg_match('/Droid/i',$agent)) $os = 'Droid';
    elseif(preg_match('/Unix/i',$agent)) $os = 'Unix';
    elseif(preg_match('/Windows/i',$agent)) $os = 'Windows';
    elseif $os = 'Unknown';
       // Browser Detection
  if(preg_match('/Firefox/i',$agent)) $br = 'Firefox';
      elseif(preg_match('Mac/i',$agent)) $br = 'Mac';
      elseif(preg_match('Chrome/i',$agent)) $br = 'Chrome';
      elseif(preg_match('Opera/i',$agent)) $br = 'opera';
      elseif(preg_match('MSIE/i',$agent)) $br = 'IE';
      else $bs = 'Unknown';
  
  ?&gt;
  </code></pre>