输出Eggdrop / PHP之前的空格

时间:2016-06-22 03:03:58

标签: php eggdrop

在使用Eggdrop和PHP输出之前,我遇到了空间问题 我的eggdrop输出文本很好,但在文本前面有一个空格。 有人可以帮助我,以前删除空间!

PHP代码

function ircbot($messages)
{
    $bot = array(
        'ip' => 'XXX.XXX.XXX.XXX',
        'port' => 24587,
        'pass' => 'somepassword_',
        'pidfile' => '/home/$USER/egg/pid.eggd', //path to the pid. file
        'sleep' => 5,
    );
    if (empty($messages)) die ('Empty message');
    if (!file_exists($bot['pidfile'])) die ('Bot not online');
    if ($bot['hand'] = fsockopen($bot['ip'], $bot['port'], $errno, $errstr, 45)) {
        sleep($bot['sleep']);
        if (is_array($messages)) {
            foreach ($messages as $message) {
                fputs($bot['hand'], $bot['pass'] . ' ' . $message . "\n");
                sleep($bot['sleep']);
                return "Message sent";
            }
        } else {
            fputs($bot['hand'], $bot['pass'] . ' ' . $messages . "\n");
            sleep($bot['sleep']);
            return "Message sent";
        }
        fclose($bot['hand']);
    }
}

外出看起来像

[04:52:47] <&Egg_D_R>  test 5

正如你所看到的,在测试之前有一个空格。

如果我替换。 '<。strong>与它不会工作:(,我已经尝试过了

0 个答案:

没有答案