问题
If I have this output of an array :
$array_to_delete =
[
(int) 3 => (int) 4,
(int) 4 => (int) 5
]
And i want to get 4 and 5 and so on at where condition , Like that :
$warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
->where(['id', $array_to_delete])
->all();
How can i do that ? in cake php
回答1:
use IN
$warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
->where(['id IN', $array_to_delete])
->all();
来源:https://stackoverflow.com/questions/45481414/getting-value-from-string-array-in-cake-php