Take a look at this library:
Provides you with a complete OOP API (> PHP5) for communication using this protocol.
By default, it uses TLS, so you will not have problems connecting to the google talk server.
Check out this sample code:
<?php
include("xmpp.php");
$conn = new XMPP('talk.google.com', 5222, 'username', 'password', 'xmpphp',
'gmail.com', $printlog=False, $loglevel=LOGGING_INFO);
$conn->connect();
$conn->processUntil('session_start');
$conn->message('someguy@someserver.net', 'This is a test message!');
$conn->disconnect();
?>
source
share