I'm getting this string which I can't control:
$string = '[{"val":"agent,,james,,89","number":0,"dID":0}, {"val":"house,,Villa,,389m","number":1,"dID":2}]';
Would like to only collect the val and put them into an array where they are separated by the two commas
End results:
var_dump($resArr) // Array [{"agent", "james", "89"}, {"house", "villa", "389m"}]
What I've done so far:
$string = '[{"val":"agent,,james,,89","number":0,"dID":0}, {"val":"house,,Villa,,389m","number":1,"dID":2}]';
parse_str(stripslashes(str_replace(["'=>'","','"],['=','&'],trim($string,"'"))),$form_data);
var_dump($form_data);