First of all I'm sorry for my English.
My xml code part is here;
[390] => SimpleXMLElement Object
(
[code] => 484
[barcode] => 9518
[supplier_code] => 9518
[name] => 9518 Bayan Kilot
[cat1name] => Bayan Külot
[cat1code] => 10
[cat2name] => SimpleXMLElement Object
(
)
[cat2code] => SimpleXMLElement Object
(
)
[cat3name] => SimpleXMLElement Object
(
)
[cat3code] => SimpleXMLElement Object
(
)
[stock] => 39971
[price_list] => 0,00
[price_list_camping] => 13,50
[currency] => TL
[vat] => 8
[brand] => Polat Yıldız
[detail] => SimpleXMLElement Object
(
)
[images] => SimpleXMLElement Object
(
[image] => http://ift.tt/1ECKLlF
)
[bodies] => SimpleXMLElement Object
(
[body] => Array
(
[0] => 6 Adet -Battal
[1] => 6 Adet -Battal
)
[color_code] => Array
(
[0] => 840
[1] => 839
)
[stock] => Array
(
[0] => 19981
[1] => 19990
)
)
[colors] => SimpleXMLElement Object
(
[color] => Array
(
[0] => KIRMIZI
[1] => SİYAH
)
[colorcode] => Array
(
[0] => 840
[1] => 839
)
)
)
and my php code is here ;
$renkKodu = (int)$urun -> bodies -> color_code[$i];
if($renkKodu <= 0 || !$renkKodu){
$ozellik_adi = $beden;
}else if($renkKodu > 0){
if($urun -> colors -> color && $urun -> colors -> colorcode){
$renkArray = $urun -> colors -> color;
echo is_array($renkArray) ? 'Array' : 'Not array';
$key = array_search($renkKodu, $urun -> colors -> colorcode);
}else {
$ozellik_adi = $beden;
}
}
PHP returns 'Not array'. I cant understand this. I see array in xml, but php says it is not array. Please help me :(
No comments:
Post a Comment