title: Real time Chat application with PHP & Websockets
body: <p>I want to create chat application in a webapp where user can chat with different site users. This will be available on web and also on iOS.</p>
  
  <p>Instead of using traditional polling technique (send ajax hit to server in 1 sec interval), i want to use websockets.</p>
  
  <p>Gone through couple of tutorials, but in all of them they have made PUBLIC GROUP chat. (Sample URL : <a href="https://www.sanwebe.com/2013/05/chat-using-websocket-php-socket" rel="nofollow noreferrer">https://www.sanwebe.com/2013/05/chat-using-websocket-php-socket</a>)</p>
  
  <p>Can anyone have idea to how to develop private chat using PHP &amp; Websockets.</p>
  
  <p>I have basic idea of websockets but how to use them to publish data on specific channel? And if we have 40 users so do we need to create 40 different channels?</p>
  
  <p>Thanks in advance.</p>