'; $codes = Array('USD', 'EUR'); echo '-2-|
'; $rates = Array(); preg_match_all('#(.*?)#', $XMLrates, $rates['title']); preg_match_all('#(.*?)#', $XMLrates, $rates['quantity']); preg_match_all('#(.*?)#', $XMLrates, $rates['rate']); preg_match_all('#(.*?)#', $XMLrates, $rates['code']); echo '3-33
'; echo '666
'; for ($i = 0; $i < 10; $i++) { } echo '3-33
'; echo dump(print_r($rates, 1)); die('18'); for ($i = 0; $i < count($rates['title'][1]); $i++) { $rates[$i]['title'] = $rates['title'][1][$i]; $rates[$i]['quantity'] = $rates['quantity'][1][$i]; $rates[$i]['rate'] = $rates['rate'][1][$i]; $rates[$i]['code'] = $rates['code'][1][$i]; echo $i." - $rates[$i]['code']
"; } echo '3-33
'; echo dump(print_r($rates, 1)); die('18'); foreach ($rates as $key => $value) if (!in_array($value['code'], $codes)) unset($rates[$key]); echo dump(print_r($rates, 1)); //echo $XMLrates; ?>