I was wondering if it is possible within a foreach loop to edit the current object thats being handled.
I'm working with an array of objects $questions and I want to go through and look for the answers associated with that question object in my db. So foreach question go fetch the answer objects and update the current $question inside my foreach loop so I can output/process elsewhere.
foreach($questions as $question){
$question['answers'] = $answers_model->get_answers_by_question_id($question['question_id']);
}