Configuring a currency converter to get exchange rate feeds for for multiple currencies
Well the first thing I notice is that your get_currency_rate() function requires a $currencySource to be added as a parameter. Which makes the first if statement a little redundant. The other thing is that get_currency_rate() is setting the variable $rate from get_rate(), but get_rate() doen't return anything.

I think you should ommit the get_currency_rate() function and change get_rate() to handle the XML feed request and return the information you want rather than using two separate functions.

It would look like this.

function get_rate($feed_url, $xmlTagPosition) {
  $xml = new SimpleXmlElement($feed_url);
  $xml_item = $xml-&gt;channel-&gt;item[$xmlTagPosition];

  // make sure the $xmlTagPosition was valid
  if( empty($xml_item) )
    return false;

  $currency['rate'] = $xml_item-&gt;description;
  preg_match('/([0-9]+\.[0-9]+)/', $currency['rate'], $matches);
  $rate = $matches[0];

  $title['rate'] = $xml_item-&gt;title;
  $title = explode('/', $title['rate']);
  $title = $title[0];

  return $rate . ' ' . $title;
}


And now your cityConfig.php file can work more like this.

$theMoneyConverter = 'http://themoneyconverter.com/rss-feed/USD/rss.xml';

$cities = array(
  'London' =&gt; array(
    'title' =&gt; '1 British Pound Sterling',
    'currency_id' =&gt; 15
  ),
  'New York' =&gt; array(
    'title' =&gt; '1 US Dollar',
    'currency_id' =&gt; 16
  ),
  'Paris' =&gt; array(
    'title' =&gt; '1 Euro',
    'currency_id' =&gt; 56
  )
);

// now you can easily find and loop through each of your cities
foreach( $cities as $city =&gt; $info ) {
  echo '&lt;p&gt;';
  echo "$city - {$info['title']}";
  echo get_rate($theMoneyConverter, $info['currency_id']);
  echo '&lt;/p&gt;';
}