Skip to content

Instantly share code, notes, and snippets.

@gelinger777
Created December 4, 2014 20:42
Show Gist options
  • Save gelinger777/e2c60de12424d5f4b0da to your computer and use it in GitHub Desktop.
Save gelinger777/e2c60de12424d5f4b0da to your computer and use it in GitHub Desktop.
if (($xml = simplexml_load_file('http://www.cba.am/_layouts/rssreader.aspx?rss=280F57B8-763C-4EE4-90E0-8136C13E47DA')) != false) {
$items = $xml->channel->item;
$c1 = $items[0];
$dolar = $c1->title;
$dolar = explode("-", $dolar);
$c2 = $items[9];
$euro = $c2->title;
$euro = explode("-", $euro);
$USD = floatval(trim($dolar[2]));
$EUR = floatval(trim($euro[2]));
if ($USD < 1 or $EUR < 1) {
return false;
}
//echo $USD."<br />".$EUR;die;
$this->db->update('ave_currency', array(
'extra' => $USD), array(
'id' => 0), 1);
echo '.' . "\r\n";
$this->db->update('ave_currency', array(
'extra' => $EUR), array(
'id' => 2), 1);
echo "." . "\r\n";;
$sql = "UPDATE ave_items SET price_amd =price*? where cur_id=?";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment