Hash->extract($row, 'local_tools'); $output = []; foreach ($tools as $tool) { $output[] = sprintf( '%s: %s', h($tool['id']), h($tool['name']), h($tool['status']) ); } echo implode('', $output); ?>