- array_combine: documentation ( source)
- preg_match_all: documentation ( source)
- var_export: documentation ( source)
<?php
$tag = '[person name="Jackson" family="Smith"]';
var_export(preg_match_all('~(?:\G|\[\w+) (\w+)="(\w+)"~', $tag, $out) ? array_combine($out[1], $out[2]) : []);