<?php $mystring = 'first_group, second_group, third_group'; $results = explode(', ', $mystring); foreach($results as $row){ $expected[] = ['key'=>$row]; } print_r($expected); ?>
You have javascript disabled. You will not be able to edit any code.