examples/whatsapp.php
public function processReceivedMessage($phone, $from, $id, $type, $time, $name, $data)
    {
        $matches = null;
        $time = date('Y-m-d H:i:s', $time);
        if (preg_match('/\d*/', $from, $matches)) {
            $from = $matches[0];
        }
        $this->messages[] = ['phone' => $phone, 'from' => $from, 'id' => $id, 'type' => $type, 'time' => $time, 'name' => $name, 'data' => $data];
    }
public function processReceivedMessage($phone, $from, $id, $type, $time, $name, $data)
    {
        $matches = null;
        $time = date('Y-m-d H:i:s', $time);
        if (preg_match('/\d*/', $from, $matches)) {
            $from = $matches[0];
        }
        $this->messages[] = ['phone' => $phone, 'from' => $from, 'id' => $id, 'type' => $type, 'time' => $time, 'name' => $name, 'data' => $data];
    }
public function processReceivedMessage ( $ phone , $ from , $ id , $ type , $ time , $ name , $ data ) { $ matches = null ; $ time = date ( 'Y-m-d H:i:s' , $ time ) ; if ( preg_match ( '/\d*/' , $ from , $ matches ) ) { $ from = $ matches [ 0 ] ; } $ this -> messages [ ] = [ 'phone' => $ phone , 'from' => $ from , 'id' => $ id , 'type' => $ type , 'time' => $ time , 'name' => $ name , 'data' => $ data ] ; }
Process inbound text messages.

If an inbound message is detected, this method will
store the details so that it can be shown to the user
at a suitable time.

@param string $phone The number that is receiving the message
@param string $from  The number that is sending the message
@param string $id    The unique ID for the message
@param string $type  Type of inbound message
@param string $time  Y-m-d H:m:s formatted string
@param string $name  The Name of sender (nick)
@param string $data  The actual message

@return void
Process inbound text messages .