public static function parse($statusVariable)
{
if (!empty($statusVariable[0]) && $statusVariable[0] == '#') {
$statusVariable = substr($statusVariable, 1);
}
$variables = array();
$parts = explode('&', $statusVariable);
foreach ($parts as $part) {
$tmp = explode('=', $part);
if (isset($tmp[1])) {
$key = $tmp[0];
$val = urldecode($tmp[1]);
if (substr($key, -5) == '_json') {
$key = substr($key, 0, -5);
$val = json_decode($val);
}
$variables[urldecode($key)] = $val;
} else {
$variables[urldecode($tmp[0])] = null;
}
}
return $variables;
}