fork(1) download
  1. <?php
  2.  
  3.  
  4. $input ="[['name' => 'test'], ['type' => 'VARCHAR(15)'], ['null' => false], ['prim' => true]],
  5. [['name' => 'test'], ['type' => 'VARCHAR(15)'], ['null' => false], ['prim' => true]]";
  6.  
  7. $raw = '['.str_replace(array("[[","]]","=>","'","[","]"),array("{","}",":",'"',"",""),$input).']';
  8.  
  9. $output = json_decode($raw,true);
  10.  
  11. print_r($output);
  12.  
Success #stdin #stdout 0s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [name] => test
            [type] => VARCHAR(15)
            [null] => 
            [prim] => 1
        )

    [1] => Array
        (
            [name] => test
            [type] => VARCHAR(15)
            [null] => 
            [prim] => 1
        )

)