<?php


$input = "[['name' => 'id'], ['type' => 'INT(12)'], ['null' => true], ['prim' => true]], [['name' => 'test'], ['type' => 'VARCHAR(15)'], ['null' => false], ['prim' => true]]";
$raw = '['.
    preg_replace(array("/\[([^[{])/","/([^}])\]/"),array("{ $1","$1 }"),
        str_replace(array("=>","'"),array(":",'"'),$input)
        ).
    ']';

$output = json_decode(
    $raw,
    true
);

print_r( $raw);
print_r($output);
