Answers for "how to subscribe using mqtt in php"

PHP
0

how to subscribe using mqtt in php

//Additional callback functions required for subscribe
function subscribe() {
                       //**Store the status to a global variable - debug purposes
		$GLOBALS['statusmsg'] = $GLOBALS['statusmsg'] . "SUB-OK|";
}

function message($message) {
                       //**Store the status to a global variable  - debug purposes
		$GLOBALS['statusmsg']  = "RX-OK|";

                       //**Store the received message to a global variable
		$GLOBALS['rcv_message'] =  $message->payload;
}
Posted by: Guest on May-22-2021

Browse Popular Code Answers by Language