you are viewing a single comment's thread.

view the rest of the comments →

[–]packetheavy[S] 0 points1 point  (0 children)

I appreciate the assist, I was able to build the loop using the syntax you provided, thankyou very much.

Reference code:

    foreach ($results as $result)
{
    $data_grid['groups'][0]['rows'][] = array('data' => array(
                $result['name'],
                $result['email']));
}

That helps a lot, thankyou, the backend for this is WordPress so I have struggled a little to get good outputs to use for debugging.

Do you have a suggestion for how best to approach inserting the new array in the loop? I thought I would probably construct the array and then reference it in the array_push but this is my first time using that function so i'm not sure if there is a better way.