0) { $items = explode(';', $obj); $item = $items[0]; $id = explode('=', $items[0], 2); if (count($id) == 1) $name = $id[0]; else $name = $id[0].$id[1]; if (strlen($name) == 0) $name = 'null'; if (isset($data[$name])) { $num = 1; while (isset($data[$name.$num])) $num++; $name .= $num; } $counter = 0; foreach ($items as $item) { $id = explode('=', $item, 2); if (count($id) == 2) $data[$name][$id[0]] = $id[1]; else $data[$name][$counter] = $id[0]; $counter++; } } } if ($cmd == 'summary') return array_pop($data); else return $data; } ob_start(); $summary = request('summary'); $threads = request('threads'); $histo = array();//request('histo'); /* only enable it if required... */ ob_end_clean(); //echo ob_get_clean()."\n"; /* allow to print protocol debug message */ header("Content-Type: application/json"); echo json_encode(compact('summary', 'threads', 'histo'))."\n"; ?>