Welcome to PHPBuilder!
Is it possible in a theoretical sense? Definitely yes. Is it practical to use PHP for this purpose? Some might say no, but it is indeed possible.
If you know the protocol, all that PHP really "needs" to know how to do is connect to a remote socket and let you use that protocol, and to that end there is a [man]sockets[/man] extension which may be used.