public static function encodeMessage($message)
    {
        $waitingData = strlen($message);
        $header = str_pad((string)$waitingData,8,'0',STR_PAD_LEFT);
        return $header.$message;
    }
public static function encodeMessage($message)
    {
        $waitingData = strlen($message);
        $header = str_pad((string)$waitingData,8,'0',STR_PAD_LEFT);
        return $header.$message;
    }
public static function encodeMessage ( $ message ) { $ waitingData = strlen ( $ message ) ; $ header = str_pad ( ( string ) $ waitingData , 8 , '0' , STR_PAD_LEFT ) ; return $ header . $ message ; }
Encode the message with header and body to directly write to any socket
@param string $message
@return string
Encode the message with header and body to directly write to any socket