Formatting messages for the ICQ client in PHP

Guys, I need help.

I’m writing an ICQ Client in PHP and I’ve run into this problem. Here is a piece of code:

//   ,    
$icq->sendMessage($array['admin_icq'], ", ! ,  .");
$icq->sendMessage($array['admin_icq'], "echo '123';");

I get the following:

(17:17:54 1/08/2011)
, ! ,  .
 (17:17:54 1/08/2011)
echo '123';

And I would like it to come out like this:

(17:17:54 1/08/2011)
, ! ,  .
 (17:17:54 1/08/2011)
123

Who knows well the syntax in php – please help. Thank you in advance. 🙂


Answer 1, authority 100%

$var = 'ololo';
ob_start();
echo '321';
$var2 = ob_get_contents();
ob_end_clean();
$icq->sendMessage($array['admin_icq'], '123 '.date('H:i:s').' '.$var.' '.$var2);

Disassemble, see functions at php.net


Answer 2

Remove echo, leave 123, similar to the previous message.