i ran a for loop over an array (ids) to find record s from db...how can i combine them into an array of single object.
$ids=array(1,2,3,4);
foreach($ids as $id){
data[]=Model::findFirstById($id)
}
i ran a for loop over an array (ids) to find record s from db...how can i combine them into an array of single object.
$ids=array(1,2,3,4);
foreach($ids as $id){
data[]=Model::findFirstById($id)
}