function packCreateMsg($taskType, $data) { $taskId = rand(1, 1000); $result = packMsg($taskType, $taskId, $data); return $result; }
function success($type, $data) { $body = packMsg($type, $data); if (FOOKING) { header("Content-Length: " . strlen($body)); } echo $body; }