title: Parsing chrome version from user agent
body: <p>I need to find the version of Chrome using PHP.</p>
  
  <p>I coded this:</p>
  
  <pre><code>$ua = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.60 Safari/537.1";
  preg_match( "#Chrome/([0-9]{2})#", $ua, $match );
  print_r($match);
  </code></pre>
  
  <p>Which returns:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Chrome/21
      [1] =&gt; 21
  )
  </code></pre>
  
  <p>I have two questions:</p>
  
  <p>Will this work on all chrome browsers? (because the $ua is my own user agent.</p>
  
  <p>Also how can I make the pattern so it returns only "21" instead of "Chrome/21" and "21" in an array?</p>