how to subscribe using mqtt in php

Solutions on MaxInterview for how to subscribe using mqtt in php by the best coders in the world

showing results for - "how to subscribe using mqtt in php"
Rafaela
08 Sep 2019
1//Additional callback functions required for subscribe
2function subscribe() {
3                       //**Store the status to a global variable - debug purposes
4		$GLOBALS['statusmsg'] = $GLOBALS['statusmsg'] . "SUB-OK|";
5}
6
7function message($message) {
8                       //**Store the status to a global variable  - debug purposes
9		$GLOBALS['statusmsg']  = "RX-OK|";
10
11                       //**Store the received message to a global variable
12		$GLOBALS['rcv_message'] =  $message->payload;
13}
14