Estou com um problema com a função in_array.
Fiz um var_dump()
na array que quero procurar:
array(2) {
["28c8edde3d61a0411511d3b1866f0636"]=> array(8) {
["id"]=> string(32) "c4ca4238a0b923820dcc509a6f75849b"
["qty"]=> float(1)
["price"]=> float(2500)
["name"]=> string(13) "Album: Xim-ER"
["type"]=> string(5) "Asset"
["weight"]=> string(3) "115"
["rowid"]=> string(32) "28c8edde3d61a0411511d3b1866f0636"
["subtotal"]=> float(2500)
}
["dc74f1aaf0e81b424c56cbd906f3d3c3"]=> array(8) {
["id"]=> string(33) "Dc4ca4238a0b923820dcc509a6f75849b"
["qty"]=> float(1)
["price"]=> float(2000)
["name"]=> string(21) "Album: Xim-ER Digital"
["type"]=> string(7) "Digital"
["weight"]=> string(1) "0"
["rowid"]=> string(32) "dc74f1aaf0e81b424c56cbd906f3d3c3"
["subtotal"]=> float(2000)
}
}
Preciso ver nessa Array se eu tenho Asset, então eu fiz o seguinte no meu controller:
<?php
$order->Shipping = new stdClass ();
if (in_array ( array ('type','Asset'), $cart_array )) {
$order->Shipping->Type = 'Correios';
$order->Shipping->SourceZipCode = '25670202';
$order->Shipping->TargetZipCode = $this->session->userdata ( 'user_cep' );
$order->Shipping->Address = new stdClass ();
$order->Shipping->Address->Street = $this->session->userdata ( 'user_adress' );
$order->Shipping->Address->Number = $this->session->userdata ( 'user_adress_number' );
$order->Shipping->Address->Complement = $this->session->userdata ( 'user_adress_comp' );
$order->Shipping->Address->District = $this->session->userdata ( 'user_adress_district' );
$order->Shipping->Address->City = $this->session->userdata ( 'user_city' );
$order->Shipping->Address->State = $this->session->userdata ( 'user_state' );
} else {
$order->Shipping->Type = 'WithoutShipping';
}
Porém ele só retorna o shipping com WithoutShipping.
Esqueci algum parâmetro para fazer o in_array corretamente?