title: From the locale, how do I get the currency code?
body: <p>PHP has an <code>intl</code> module which allows for some cool things - like getting the currency symbol when using the <a href="http://php.net/manual/en/class.numberformatter.php" rel="nofollow noreferrer"><code>NumberFormatter</code></a> class. But this is making a massive assumption - that you already have the currency code of the currency you want to get the symbol for.</p>
  
  <p>How do I get the currency code for any specific locale?</p>
  
  <p>For example: <code>en_gb</code> => <code>gbp</code>, <code>en_us</code> => <code>usd</code>, <code>es_es</code> => <code>eur</code></p>
  
  <p>I am doing this so I can use the <code>currencyFormat</code> view helper in ZendFramework 2:</p>
  
  <pre><code>$locale = 'en_gb'; //from get parameter
  $symbol = 'GBP'; //How do get this?
  
  $this-&gt;serviceManager
           -&gt;get('viewhelpermanager')
           -&gt;get('currencyFormat')
           -&gt;setLocale($locale)
           -&gt;setCurrencyCode($symbol);
  </code></pre>