Regexp for re-phasing input name from dot notation preg_replace('/\.([a-z0-9$\_]+)/im', '[${1}]', $field); // a.b.c => a[b][c] `