public static function send_command($client, $msg, $reciver) { if (DEBUG) { echo "send_command\n"; } $messobj = new message("command", $client, $msg, $reciver); $msg = json_encode($messobj); $msg = other::encoded($msg); socket_write($reciver->socket, $msg, strlen($msg)); }