. * * Version 0.1 * Author: Octavio Benedi Sanchez */ function jsondecode ($json) { //remove curly brackets to beware from regex errors $json = substr($json, strpos($json,'{')+1, strlen($json)); $json = substr($json, 0, strrpos($json,'}')); $json = preg_replace('/(^|,)([\\s\\t]*)([^:]*) (([\\s\\t]*)):(([\\s\\t]*))/s', '$1"$3"$4:', trim($json)); $json=str_replace('\\"','"',$json); $json=str_replace('\\"','"',$json); return json_decode('{'.$json.'}', true); } ?>