News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Feichtinger's Blog:
PHP5 WebSocket Example - A Simple Chat
February 03, 2011 @ 09:47:28

Michael Feichtinger has posted a simple websocket example to his blog today. It shows the creation of a simple "web chat" application for real-time communication without the mess that can come with ajax.

The classic example for websockets is a chat. This chat example has only 200 lines of code (excl. the Websocket class), is really easy to understand and customizable.

He creates a basic "WebsocketClass" class that (in his example) connects to an IP and port. It uses JSON as the messaging format and some basic javascript to handle the clicks of the "chat" and "login" buttons. You can see an example in action here and download the source for the server.php here.

0 comments voice your opinion now!
websocket exmaple tutorial chat realtime json javascript


blog comments powered by Disqus

Similar Posts

Sameer Borate's Blog: Generating a color palette from a image in php

Gennady Feldman's Blog: Installing Oracle Instant Client 11g and PECL OCI8 (Part 2)

Jason Fox: Use the Accept Header to Set Your Return Data With Zend Framework 2

The Shadow Fox Network: Building an RSS Feed From a Database

Chris Hartjes' Blog: Where Are The Good Development Tools For PHP?


Community Events





Don't see your event here?
Let us know!


update series framework podcast deployment package introduction zendserver unittest symfony laravel interview install release language library tips community opinion api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework