Simple Websocket

Simple Websocket Writen in PHP and Javascript

Websocket How to
JavascriptDownload
JS Usage Example
By Variable OR Const
const start_socket = false;
if (start_socket){
  socket_start();
}
      
By Element Exists
var websocketElement = document.getElementById('websocket'); //find any elements with id websocket
if (websocketElement){
  socket_start();
}
      
Others

You can use it as your wish. OR using basic example bellow :

if (conditional) {
  socket_start();
}
            

PHPDownload
PHP Usage Example
PHP Normal Usage
$websocket = new WMI_websocket(false, false);
/* Data Example */
$websocket->createData([
  'pendapatan_max_invoice' => 45,
  'piutang_max_invoice' => 55,
  'hutang_max_invoice' => 65,
  'pengeluaran_max_invoice' => 67,
]);
$websocket->SEND();
        
PHP Object Oriented Usage
$websocket = new WMI_websocket(false, false);
$websocket->createData([
  'pendapatan_max_invoice' => 45,
  'piutang_max_invoice' => 55,
  'hutang_max_invoice' => 65,
  'pengeluaran_max_invoice' => 67,
])->SEND();
        
PHP Static Object Oriented Usage
WMI_websocket::i(false, false)->createData([
  'pendapatan_max_invoice' => 45,
  'piutang_max_invoice' => 55,
  'hutang_max_invoice' => 65,
  'pengeluaran_max_invoice' => 67,
])->SEND();
        

0 Response to "Simple Websocket"

Post a comment

Bila Ada posting yang kurang, atau error atau yang lainnya, silahkan tinggalkan komentar agar artikel/post di perbaiki.
Jangan Lupa Cek Box "Notify Me" agar tahu komentar kamu dibalas oleh saya.

If there are any posts that are missing, or error or anything else, please leave a comment for the article / post to be fixed.
Do not Forget Check Box "Notify Me" to know our comments replied by me.