title: How to print subvalues in multidimensional PHP array depending on criteria
body: <p>I don't know how to ask Google so I'm asking here. How to print sub-values in multidimensional PHP array depending on criteria. </p>
  
  <p>Example: This is array (country, capital city latitude and longitude) which I have created:</p>
  
  <pre><code>$capitals = array(
  'Bangladesh' =&gt; array('lat_capital' =&gt; '23.810332', 'long_capital' =&gt; '90.412518'),
  'Barbados' =&gt; array('lat_capital' =&gt; '13.113222', 'long_capital' =&gt; '-59.598809'),
  'Belarus' =&gt; array('lat_capital' =&gt; '53.90454', 'long_capital' =&gt; '27.561524'),
  'Belgium' =&gt; array('lat_capital' =&gt; '50.85034', 'long_capital' =&gt; '4.35171'),
  'Belize' =&gt; array('lat_capital' =&gt; '17.251011', 'long_capital' =&gt; '-88.75902'),
  'Benin' =&gt; array('lat_capital' =&gt; '6.496857', 'long_capital' =&gt; '2.628852')
  );
  
  $country = 'Belgium';
  </code></pre>
  
  <p>How do I get <code>$lat_capital</code> and <code>$long_capital</code> for <code>$country</code>? </p>
  
  <p><strong>NOTE:</strong> If necessary, I can change format of this multidimensional array. I have data like this:</p>
  
  <pre><code>Bahrain,26.228516,50.58605
  Bangladesh,23.810332,90.412518
  Barbados,13.113222,-59.598809
  Belarus,53.90454,27.561524
  Belgium,50.85034,4.35171
  Belize,17.251011,-88.75902
  Benin,6.496857,2.628852
  </code></pre>
  
  <p><strong>Additional question:</strong> Is there any better solution how to assign <code>$lat_capital</code> and <code>$long_capital</code> for <code>$country</code> then arrays? </p>