3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = array_map(function($v) { return ['key' => trim($v)]; }, explode(',', 'first_group, second_group, third_group')); print_r($result);
based on f5IDk