我有以下变量 $rows:
大批 (
[0] => stdClass Object ( [product_sku] => PCH20 ) [1] => stdClass Object ( [product_sku] => PCH20 ) [2] => stdClass Object ( [product_sku] => PCH19 ) [3] => stdClass Object ( [product_sku] => PCH19 )
)
我需要创建第二个数组 $second 仅包含唯一值:
大批 (
[0] => stdClass Object ( [product_sku] => PCH20 ) [1] => stdClass Object ( [product_sku] => PCH19 )
)
但是当我在 $rows 上运行 array_unique 时,我收到:
可捕获的致命错误:类 stdClass 的对象无法在第191行转换为字符串