我有以下$ items PHP数组......
Array (
[44567] => Order_Item Object (
[extra_data:protected] => Array (
[product_id] => 0
[variation_id] => 0
)
[data:protected] => Array (
[order_id] => 4432
[name] => Test Product
[product_id] => 99
)
[cache_group:protected] => order-items
[object_read:protected] => 1
)
)
我正在尝试使用in_array来查明它是否包含product_id 99,我试过...
if (in_array('99', $item['product_id'], true)) {
echo 'DETECTED';
}
是否有人有类似的工作示例我可以看一下?