- var_dump: documentation ( source)
- explode: documentation ( source)
<?php
function parse($args)
{
$jobArgs = [];
$list = explode(',', $args);
foreach ($list as $item)
{
$splitArg = explode('=', $item);
$jobArgs[$splitArg[0]] = $splitArg[1];
}
return $jobArgs;
}
var_dump(parse("one=test,two=another,three=win"));