Send and Receive message in Php using XMPP

Hi

I am very much new to XMPP all i wanna do is i should log in as a user and send a message to another user and then i must login as another user and receive the same. I used the following code to successfully send the message in php code..

<?php

include 'XMPPHP/XMPP.php';

#Use XMPPHP_Log::LEVEL_VERBOSE to get more logging for error reports
#If this doesn't work, are you running 64-bit PHP with < 5.2.6?
$conn = new XMPPHP_XMPP('hostname', 'host', 'username', 'password', 'xmpphp', 'host', $printlog=True, $loglevel=LOGGING_INFO);

try {
$conn->connect();
$conn->processUntil('session_start');
$conn->message('username', 'Message');
$conn->disconnect();
} catch(XMPPHP_Exception $e) {
die($e->getMessage());
}

Now i wanna know is there any sample php code to receive the same message..

thank you,

Anthony Adaikalaraj.A

Syndicate content