|
|
|
|
|
для: OLi
(11.06.2013 в 16:21)
| | Сделал так:
foreach($items->ValType as $item){
foreach ($item as $val) {
if (in_array($val->Code, $arr))
{
$val->Code." : " . $val->Value;
$x = array( (string)$val->Code=>(string)$val->Value);
$this->currency_model->UpdateValute($x);
}
}
}
|
| |
|
|
|
|
|
|
| У меня есть объект который выводу через foreach
foreach($items as $item){
var_dump($item);
}
|
И получаю следующее:
bject(SimpleXMLElement)#30 (2) {
["@attributes"]=>
array(1) {
["Type"]=>
string(17) "Xarici valyutalar"
}
["Valute"]=>
array(44) {
[0]=>
object(SimpleXMLElement)#31 (4) {
["@attributes"]=>
array(1) {
["Code"]=>
string(3) "LTL"
}
["Nominal"]=>
string(1) "1"
["Name"]=>
string(10) "Litva liti"
["Value"]=>
string(6) "0.3003"
}
[1]=>
object(SimpleXMLElement)#32 (4) {
["@attributes"]=>
array(1) {
["Code"]=>
string(3) "BYR"
}
["Nominal"]=>
string(3) "100"
["Name"]=>
string(13) "Belarus rublu"
["Value"]=>
string(6) "0.0090"
}
[2]=>
object(SimpleXMLElement)#33 (4) {
["@attributes"]=>
array(1) {
["Code"]=>
string(3) "PLN"
}
["Nominal"]=>
string(1) "1"
["Name"]=>
string(15) "Polşa zlotası"
["Value"]=>
string(6) "0.2444"
}
[3]=>
object(SimpleXMLElement)#34 (4) {
["@attributes"]=>
array(1) {
["Code"]=>
string(3) "EGP"
}
["Nominal"]=>
string(1) "1"
["Name"]=>
string(11) "Misir funtu"
["Value"]=>
string(6) "0.1124"
}
[4]=>
object(SimpleXMLElement)#35 (4) {
["@attributes"]=>
array(1) {
["Code"]=>
string(3) "SEK"
}
["Nominal"]=>
string(1) "1"
["Name"]=>
string(13) "İsveç kronu"
["Value"]=>
string(6) "0.1195"
}
[5]=>
object(SimpleXMLElement)#36 (4) {
["@attributes"]=>
array(1) {
["Code"]=>
string(3) "CNY"
}
["Nominal"]=>
string(1) "1"
["Name"]=>
string(11) "Çin yuanı"
["Value"]=>
string(6) "0.1280"
}
|
Как вывести значения Code, Value? | |
|
|
|
|