News Feed
Jobs Feed
Sections




News Archive
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

DevShed: Filtering Image Streams with the GD Library in PHP

IBM developerWorks: Paint 3-D images with PHP

Larry Garfield's Blog: Good SPL intro

Anna Filina's Blog: Symfony - subfolders for partials

Ian Selby's Blog: Making RESTful Requests in PHP


Community Events









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


phpunit api zendframework2 testing language tool development database introduction object framework unittest code opinion composer podcast community release example interview

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