$var ="
{
key : {
key_deep : val\{ue /* should be "val{ue" as { is escaped */
} ,
key2 : value
}
";
print_r(preg_split('//',$var));
// array(
// array(
// 'key'=> array(
// 'key_deep'=> 'val{ue'
// )
// ),
// array('key2'=>'value')
// );
is there a regular expression to split this using preg_split in php?
basically I need the same as json_decode() but without the need of the the quotes on BOTH value
and key
and the only thing escaped are four characters \{ \, \} \: